pytest-dev / py

Python development support library (note: maintenance only)
MIT License
67 stars 105 forks source link

How do I turn off escaping? #274

Closed headtr1ck closed 2 years ago

headtr1ck commented 2 years ago

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.

RonnyPfannschmidt commented 2 years ago

wrap into py.xml.raw

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

headtr1ck commented 2 years ago

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