Re: http links translated to html : target "_blank"

2021-02-04 Thread Uwe Brauer
>>> "JMM" == Juan Manuel Macías  writes:

> Uwe Brauer  writes:
>> That is odd (maybe my org version is a bit rusty (master june 2020)

> It's strange...

> It should work fine for you (as long as you set
> `org-export-allow-bind-keywords' as non-nil)

Aha, indeed it was nil! I was not even aware of this variable, after
switching to t, your code worked. Thanks because it save me the hassle
to add manually 
#+attr_latex

On the other hand it is good to know that booth solution exits.

Thanks

Uwe 


smime.p7s
Description: S/MIME cryptographic signature


Re: http links translated to html : target "_blank"

2021-02-01 Thread Juan Manuel Macías
Uwe Brauer  writes:

> That is odd (maybe my org version is a bit rusty (master june 2020)

It's strange...

It should work fine for you (as long as you set
`org-export-allow-bind-keywords' as non-nil)

You can also try `org-export-filter-link-functions' instead of
`...-final-output-functions'.

Anyway, if the `#+attr_latex' solution works for you, then all is fine.

Best regards,

Juan Manuel 



Re: http links translated to html : target "_blank"

2021-02-01 Thread Uwe Brauer
>>> "JMM" == Juan Manuel Macías  writes:

   > Hi Uwe,
   > Uwe Brauer  writes:

   >> Thanks that works, but not for link in a list. The only solution 
   >> seems to be this one

   > Doesn't it work for you in a list? I think it should work also in a
   > list. If I export this:

   > #+begin_src org
   >   ,#+BIND: org-export-filter-final-output-functions (correct-target-blank)
   >   ,#+begin_src emacs-lisp :exports results :results none
   > (defun correct-target-blank (text backend info)
   >  (when (org-export-derived-backend-p backend 'html)
   >(replace-regexp-in-string "%20target=%22_blank%22\""  "\" 
target=\"_blank\"" text)))
   >   ,#+end_src

   > + 
[[https://www.amazon.es/Rocketbook-Everlast-Notebook-riutilizzabile-Esecutivo/dp/B071Y3MSRK/ref=sr_1_5?__mk_es_ES=%C3%85M%C3%85%C5%BD%C3%95%C3%91&dchild=1&keywords=Rocketbook&qid=1607847519&sr=8-5&th=1
 target="_blank"][Book A4]]

   > + 
[[https://www.amazon.es/Rocketbook-Everlast-Notebook-riutilizzabile-Esecutivo/dp/B071Y3MSRK/ref=sr_1_5?__mk_es_ES=%C3%85M%C3%85%C5%BD%C3%95%C3%91&dchild=1&keywords=Rocketbook&qid=1607847519&sr=8-5&th=1
 target="_blank"][Book A4]]
   > #+end_src


   > I get this:

That is odd (maybe my org version is a bit rusty (master june 2020)
I obtain this:



https://www.amazon.es/Rocketbook-Everlast-Notebook-riutilizzabile-Esecutivo/dp/B071Y3MSRK/ref=sr_1_5?__mk_es_ES=%C3%85M%C3%85%C5%BD%C3%95%C3%91&dchild=1&keywords=Rocketbook&qid=1607847519&sr=8-5&th=1%20target=%22_blank%22";>Book
 A4

https://www.amazon.es/Rocketbook-Everlast-Notebook-riutilizzabile-Esecutivo/dp/B071Y3MSRK/ref=sr_1_5?__mk_es_ES=%C3%85M%C3%85%C5%BD%C3%95%C3%91&dchild=1&keywords=Rocketbook&qid=1607847519&sr=8-5&th=1%20target=%22_blank%22";>Book
 A4



smime.p7s
Description: S/MIME cryptographic signature


Re: http links translated to html : target "_blank"

2021-02-01 Thread Juan Manuel Macías
Hi Uwe,

Uwe Brauer  writes:

> Thanks that works, but not for link in a list. The only solution 
> seems to be this one

Doesn't it work for you in a list? I think it should work also in a
list. If I export this:

#+begin_src org
  ,#+BIND: org-export-filter-final-output-functions (correct-target-blank)
  ,#+begin_src emacs-lisp :exports results :results none
(defun correct-target-blank (text backend info)
 (when (org-export-derived-backend-p backend 'html)
(replace-regexp-in-string "%20target=%22_blank%22\""  "\" 
target=\"_blank\"" text)))
  ,#+end_src

+ 
[[https://www.amazon.es/Rocketbook-Everlast-Notebook-riutilizzabile-Esecutivo/dp/B071Y3MSRK/ref=sr_1_5?__mk_es_ES=%C3%85M%C3%85%C5%BD%C3%95%C3%91&dchild=1&keywords=Rocketbook&qid=1607847519&sr=8-5&th=1
 target="_blank"][Book A4]]

+ 
[[https://www.amazon.es/Rocketbook-Everlast-Notebook-riutilizzabile-Esecutivo/dp/B071Y3MSRK/ref=sr_1_5?__mk_es_ES=%C3%85M%C3%85%C5%BD%C3%95%C3%91&dchild=1&keywords=Rocketbook&qid=1607847519&sr=8-5&th=1
 target="_blank"][Book A4]]
#+end_src

I get this:

#+begin_src html

https://www.amazon.es/Rocketbook-Everlast-Notebook-riutilizzabile-Esecutivo/dp/B071Y3MSRK/ref=sr_1_5?__mk_es_ES=%C3%85M%C3%85%C5%BD%C3%95%C3%91&dchild=1&keywords=Rocketbook&qid=1607847519&sr=8-5&th=1";
 target="_blank">Book A4

https://www.amazon.es/Rocketbook-Everlast-Notebook-riutilizzabile-Esecutivo/dp/B071Y3MSRK/ref=sr_1_5?__mk_es_ES=%C3%85M%C3%85%C5%BD%C3%95%C3%91&dchild=1&keywords=Rocketbook&qid=1607847519&sr=8-5&th=1";
 target="_blank">Book A4

#+end_src

Using `#+attr_html:' is a simpler and cleaner solution, of course, but I think 
that
would not work with links within a paragraph.

Best regards / saludos,

Juan Manuel 



Re: http links translated to html : target "_blank"

2021-02-01 Thread Uwe Brauer
>>> "T" == TEC   writes:

> Uwe Brauer  writes:

>> Aha, thanks, it works, sometimes:
>> 
>> The first two work, the last two not. Not sure what to think about it

> Mmm, you need to have #+attr_html immediately followed by the link on
> the next line.

> It would be nice if there was a way to set these attributes inline with
> the link, but AFAIK that's not currently possible.

Right so this works


#+attr_html: :target _blank
[[https://www.zeit.de/wissen/gesundheit/2020-11/coronavirus-aerosols-infection-risk-hotspot-interiors][Risk
  simulator]]


#+attr_html: :target _blank
[[https://www.mpic.de/4747361/risk-calculator][Risk simulator with more 
details]]

  1. RocketBook


 + Book A4
   #+attr_html: :target _blank
   
[[https://www.amazon.es/Rocketbook-Everlast-Notebook-riutilizzabile-Esecutivo/dp/B071Y3MSRK/ref=sr_1_5?__mk_es_ES=%C3%85M%C3%85%C5%BD%C3%95%C3%91&dchild=1&keywords=Rocketbook&qid=1607847519&sr=8-5&th=1][Book
 A4]]

 a. Book A4
#+attr_html: :target _blank

[[https://www.amazon.es/Rocketbook-Everlast-Notebook-riutilizzabile-Esecutivo/dp/B071Y3MSRK/ref=sr_1_5?__mk_es_ES=%C3%85M%C3%85%C5%BD%C3%95%C3%91&dchild=1&keywords=Rocketbook&qid=1607847519&sr=8-5&th=1][Book
 A4]]




smime.p7s
Description: S/MIME cryptographic signature


Re: http links translated to html : target "_blank"

2021-02-01 Thread Uwe Brauer
>>> "JMM" == Juan Manuel Macías  writes:

Hola Juan

> I think the problem is how the exporter understands the url string.
> Note that this:

> @@html:https://www.mpic.de/4747361/risk-calculator"; 
> target="_blank">Simulador de riesgo con más detalle@@

> [[https://www.mpic.de/4747361/risk-calculator target="_blank"][Simulador de 
> riesgo con más detalle]]

> is exported like this:

> 
> https://www.mpic.de/4747361/risk-calculator"; 
> target="_blank">Simulador de riesgo con más detalle
> 

> 
>  href="https://www.mpic.de/4747361/risk-calculator%20target=%22_blank%22";>Simulador
>  de riesgo con más detalle
> 

> The second link is wrong formatted. A dirty solution could be:

> #+BIND: org-export-filter-final-output-functions (correct-target-blank)
> #+begin_src emacs-lisp :exports results :results none

>   (defun correct-target-blank (text backend info)
> (when (org-export-derived-backend-p backend 'html)
>   (replace-regexp-in-string "%20target=%22_blank%22\""  "\" 
> target=\"_blank\"" text)))
> #+end_src

> Best regards,

Thanks that works, but not for link in a list. The only solution 
seems to be this one



#+attr_html: :target _blank
[[https://www.zeit.de/wissen/gesundheit/2020-11/coronavirus-aerosols-infection-risk-hotspot-interiors][Risk
  simulator]]


#+attr_html: :target _blank
[[https://www.mpic.de/4747361/risk-calculator][Risk simulator with more 
details]]

  1. RocketBook


 + Book A4
   #+attr_html: :target _blank
   
[[https://www.amazon.es/Rocketbook-Everlast-Notebook-riutilizzabile-Esecutivo/dp/B071Y3MSRK/ref=sr_1_5?__mk_es_ES=%C3%85M%C3%85%C5%BD%C3%95%C3%91&dchild=1&keywords=Rocketbook&qid=1607847519&sr=8-5&th=1][Book
 A4]]

 a. Book A4
#+attr_html: :target _blank

[[https://www.amazon.es/Rocketbook-Everlast-Notebook-riutilizzabile-Esecutivo/dp/B071Y3MSRK/ref=sr_1_5?__mk_es_ES=%C3%85M%C3%85%C5%BD%C3%95%C3%91&dchild=1&keywords=Rocketbook&qid=1607847519&sr=8-5&th=1][Book
 A4]]




smime.p7s
Description: S/MIME cryptographic signature


Re: http links translated to html : target "_blank"

2021-02-01 Thread TEC


Uwe Brauer  writes:

> Aha, thanks, it works, sometimes:
>
> The first two work, the last two not. Not sure what to think about it

Mmm, you need to have #+attr_html immediately followed by the link on
the next line.

It would be nice if there was a way to set these attributes inline with
the link, but AFAIK that's not currently possible.

--
Timothy



Re: http links translated to html : target "_blank"

2021-02-01 Thread Uwe Brauer
>>> "T" == TEC   writes:

> Uwe Brauer  writes:

>> I need to produce a html file, with links opening new tabs (pages) as in 
>> 
>> https://apps.apple.com/es/app/radar-covid/id1520443509"; 
>> target="_blank">Descarga Directa
>> 
>> However 
>> 
>> [[https://www.mpic.de/4747361/risk-calculator target="_blank"][Simulador de 
>> riesgo con más detalle]]
>> 
>> Did not work
>> 
>> Any ideas?

> Have you tried:
> #+attr_html: :target _blank

Aha, thanks, it works, sometimes:

The first two work, the last two not. Not sure what to think about it

#+attr_html: :target _blank
[[https://www.zeit.de/wissen/gesundheit/2020-11/coronavirus-aerosols-infection-risk-hotspot-interiors][Risk
  simulator]]


#+attr_html: :target _blank
[[https://www.mpic.de/4747361/risk-calculator][Risk simulator with more 
details]]

  1. RocketBook

#+attr_html: :target _blank
 + 
[[https://www.amazon.es/Rocketbook-Everlast-Notebook-riutilizzabile-Esecutivo/dp/B071Y3MSRK/ref=sr_1_5?__mk_es_ES=%C3%85M%C3%85%C5%BD%C3%95%C3%91&dchild=1&keywords=Rocketbook&qid=1607847519&sr=8-5&th=1][Book
 A4]]


#+attr_html: :target _blank
 a. 
[[https://www.amazon.es/Rocketbook-Everlast-Notebook-riutilizzabile-Esecutivo/dp/B071Y3MSRK/ref=sr_1_5?__mk_es_ES=%C3%85M%C3%85%C5%BD%C3%95%C3%91&dchild=1&keywords=Rocketbook&qid=1607847519&sr=8-5&th=1][Book
 A4]]




smime.p7s
Description: S/MIME cryptographic signature


Re: http links translated to html : target "_blank"

2021-02-01 Thread TEC


Uwe Brauer  writes:

> I need to produce a html file, with links opening new tabs (pages) as in 
>
> https://apps.apple.com/es/app/radar-covid/id1520443509"; 
> target="_blank">Descarga Directa
>
> However 
>
>  [[https://www.mpic.de/4747361/risk-calculator target="_blank"][Simulador de 
> riesgo con más detalle]]
>
> Did not work
>
> Any ideas?

Have you tried:
#+attr_html: :target _blank

That may work.

--
Timothy



Re: http links translated to html : target "_blank"

2021-02-01 Thread Juan Manuel Macías
I think the problem is how the exporter understands the url string.

Note that this:

@@html:https://www.mpic.de/4747361/risk-calculator"; 
target="_blank">Simulador de riesgo con más detalle@@

[[https://www.mpic.de/4747361/risk-calculator target="_blank"][Simulador de 
riesgo con más detalle]]

is exported like this:


https://www.mpic.de/4747361/risk-calculator"; target="_blank">Simulador 
de riesgo con más detalle



https://www.mpic.de/4747361/risk-calculator%20target=%22_blank%22";>Simulador
 de riesgo con más detalle


The second link is wrong formatted. A dirty solution could be:

#+BIND: org-export-filter-final-output-functions (correct-target-blank)
#+begin_src emacs-lisp :exports results :results none
  (defun correct-target-blank (text backend info)
(when (org-export-derived-backend-p backend 'html)
  (replace-regexp-in-string "%20target=%22_blank%22\""  "\" 
target=\"_blank\"" text)))
#+end_src

Best regards,

Juan Manuel

Uwe Brauer  writes:

> Hi
>
> I need to produce a html file, with links opening new tabs (pages) as in
>
> https://apps.apple.com/es/app/radar-covid/id1520443509"; 
> target="_blank">Descarga Directa
>
> However
>
>  [[https://www.mpic.de/4747361/risk-calculator target="_blank"][Simulador de 
> riesgo con más detalle]]
>
> Did not work
>
> Any ideas?
>
> Thanks and regards
>
> Uwe Brauer
>
>



http links translated to html : target "_blank"

2021-02-01 Thread Uwe Brauer


Hi 

I need to produce a html file, with links opening new tabs (pages) as in 

https://apps.apple.com/es/app/radar-covid/id1520443509"; 
target="_blank">Descarga Directa

However 

 [[https://www.mpic.de/4747361/risk-calculator target="_blank"][Simulador de 
riesgo con más detalle]]

Did not work

Any ideas?

Thanks and regards

Uwe Brauer