pytest-dev / py

Python development support library (note: maintenance only)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How do I turn off escaping?

headtr1ck opened this issue · comments

I want to create a HTML script tag which requires quotes.
If I simply use

from py.xml import html
html.script( "MathJax = { tex: { inlineMath: [['$', '$'], ['\\(', '\\)']] } };")

the quotes ' get escaped and I end up with:
MathJax = { tex: { inlineMath: [['$', '$'], ['\(', '\)']] } };
which ofc does not work as javascript.
Is there a way to disable escaping? I could not find anything in the docu.

wrap into py.xml.raw

but seriously, stop using this lib, its unmaintained and we work on dropping its usage from pytest

Thanks.
And I'll get rid of this packet, was just copying what pytest-html was doing :)