• Resolved neodolphin

    (@neodolphin)


    Hello,

    Would it be possible to automatically escape XML and HTML code or any characters that require escaping? `><& etc
    Would be great to just paste that in the block and it’s automatically escape properly without any other manual processing

    Cheers

    • This topic was modified 5 years, 5 months ago by neodolphin.
Viewing 11 replies - 1 through 11 (of 11 total)
  • Thread Starter neodolphin

    (@neodolphin)

    <?xml version=&quot;1.0&quot; encoding=&quot;ISO-8859-1&quot;?>
    <catalog>
        <cd>
            <title>Empire Burlesque</title>
            <artist>Bob Dylan</artist>
            <country>USA</country>
            <country>Columbia</country>
            <price>10.90</price>
            <year>1985</year>
        </cd>
    </catalog>

    this code doesn’t work with Prismatic

    Thread Starter neodolphin

    (@neodolphin)

    Right so next time I RTFM…….. Escaping is Code Escape option in the plugin…..
    Still have little request tho. The escaping is not keeping the spacing to make the indentation nice. Any idea how to do that ?

    Plugin Author Jeff Starr

    (@specialk)

    I’m not sure about the spacing, it sort of depends on either Prism.js or Highlight.js, whichever one you have enabled. The only thing Prismatic plugin itself does is add the required scripts/styles for either; it does not add any of its own styles to front-end code.

    Let me know if you have any further questions, glad to help however possible.

    Thread Starter neodolphin

    (@neodolphin)

    Currently using prism.js in the example they have on markup we can see the spacing kept.
    Will play a bit on my test env to see if my theme mess around with it

    Plugin Author Jeff Starr

    (@specialk)

    Yeah if you need help with Prism.js, you may want to ask in the Prism.js help forum or similar. Thanks

    Thread Starter neodolphin

    (@neodolphin)

    Found the issue, was my theme default nineteen wordpress worked.
    One I’ve noted is if you don’t select a language and there is no other block then it’s not loaded.
    Also if we can transform from standard pre or code block to prismatic would be great for migration
    Otherwise loving it ??

    Plugin Author Jeff Starr

    (@specialk)

    Awesome, glad you got it sorted @neodolphin.

    For this: “if you don’t select a language and there is no other block then it’s not loaded.” That is correct and intended functionality to help ensure optimal loading of scripts (focus on performance).

    And for this: “if we can transform from standard pre or code block to prismatic would be great for migration” It is a good idea, I will see what I can do ??

    Thread Starter neodolphin

    (@neodolphin)

    Yeh now look neat 8)

    I noticed a language-none would cool to be able to select it so the CSS is still loaded because otherwise it’s a plain pre.

    Plugin Author Jeff Starr

    (@specialk)

    Ah yes good idea. I know that highlight.js provides a couple of classes that do something similar. I will see about adding such a class for prism.js.

    Thread Starter neodolphin

    (@neodolphin)

    Cool thanks ??

    Plugin Author Jeff Starr

    (@specialk)

    Just to follow up with this, the next version of Prismatic you can disable syntax highlighting while also loading the Prism.js stylesheet by adding a class of language-none. Thank you for the suggestion, @neodolphin.

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘XML and HTML Escaping’ is closed to new replies.