emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] How to export strings froom options to JS variables?


From: Marcin Borkowski
Subject: Re: [O] How to export strings froom options to JS variables?
Date: Sat, 06 Dec 2014 10:50:54 +0100

On 2014-12-06, at 09:07, Sebastien Vauban wrote:

> Marcin Borkowski wrote:
>> I have this near the beginning my Org file:
>>
>> #+ATTR_COOL: How cool is that!
>>
>> I want it to be exported to something like
>>
>> <script>var how_cool = 'How cool is that!'
>>
>> There is a problem, hovever, what happens if some clever kid exploited
>> it, putting things like apostrophes into the string:
>>
>> #+ATTR_COOL: It's nice!
>>
>> which gets exported to
>>
>> <script>var how_cool = 'It's nice!</script>
>>
>> and hilarity ensues.
>>
>> So, my question is: how to solve this problem?
>
> Though I did not try, I think that a macro should make it.

Well, org-mode's HTML export already does something very similar.  I
just don't know what function does that.

> Best regards,
>   Seb

Best,

-- 
Marcin Borkowski
http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
Faculty of Mathematics and Computer Science
Adam Mickiewicz University



reply via email to

[Prev in Thread] Current Thread [Next in Thread]