escaping function for html attributes

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

escaping function for html attributes

Emmanuelle Morlock
Dear list,

is there a function that converts a string in something usable in a html attribute? I’m trying to put some tei transformed node in a html template using a bootstrap popover. As I have square brackets in my string (e.g.. dolor sit a[me]t), I need to pass it to an attribute of the element that is animate with javascript…

thanks
Emmanuelle


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open
Reply | Threaded
Open this post in threaded view
|

Re: escaping function for html attributes

Joe Wicentowski
Hi Emmanuelle,

Could you please be a little more specific about what you mean by
"something usable in a html attribute"?

Joe

> is there a function that converts a string in something usable in a html
> attribute? I’m trying to put some tei transformed node in a html template
> using a bootstrap popover. As I have square brackets in my string (e.g..
> dolor sit a[me]t), I need to pass it to an attribute of the element that is
> animate with javascript…

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open
Reply | Threaded
Open this post in threaded view
|

Re: escaping function for html attributes

Joe Wicentowski
Hi Emmanuelle,

Ah, I see. We're you able to find a solution to replacing the pair of square brackets with a span tag?  Or do you still need suggestions for how to do that?

Joe

On Wed, May 10, 2017 at 7:32 AM Emmanuelle Morlock <[hidden email]> wrote:
Thanks Joe !
actually I didn’t tested enough. It’s not the the html attribute (a 'data-original-title' on a button element) per se.
the pb came from the fact that the variable I wanted to pass to the ‘data-original-title’ contained span tags and not the brackets 
dolor sit a<span class=’something’>met</span> instead of sit a[me]t)…

Best
Emmanuelle



De: Wicentowski Joe [hidden email]
Répondre: Wicentowski Joe [hidden email]
Date: 9 mai 2017 at 17:23:17
À: Morlock Emmanuelle [hidden email]
Cc: [hidden email] [hidden email]
Sujet:  Re: [Exist-open] escaping function for html attributes

Hi Emmanuelle,

Could you please be a little more specific about what you mean by
"something usable in a html attribute"?

Joe

> is there a function that converts a string in something usable in a html
> attribute? I’m trying to put some tei transformed node in a html template
> using a bootstrap popover. As I have square brackets in my string (e.g..
> dolor sit a[me]t), I need to pass it to an attribute of the element that is
> animate with javascript…
--
Sent from my iPhone

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open