Search

I have a section with a textarea field. I have only the three default text formatters that come with the Markdown extension. All three Markdown formatters escape the HTML in the textarea (i.e., < and > are replaced by their character entity representations). Choosing “None” as the text formatter results in unescaped HTML, but of course then I don’t get the benefit of Markdown syntax.

I’m sure that the problem isn’t on the XSLT end, because the debug panel shows escaped HTML, and a quick look at the database shows that the value of the formatted textarea has escaped HTML.

@tachyondecay - I don’t know if this is what you are looking for. But to disable output escaping on your output, when using the xsl:value-of element, you can disable output escaping like so…

<xsl:value-of select="description" disable-output-escaping="yes"/>

Is your issue that the content of the textarea is escaped before you do any xslt transformations? If so, check out my Codearea extension

All three Markdown formatters escape the HTML in the textarea (i.e., < and > are replaced by their character entity representations

Hmm this sounds like a bug. You should be able to mix HTML and Markdown in your textarea without them conflicting. What happens if you add a markdown attribute to your HTML:

<div markdown="1">**bold text**</div>

This should tell Markdown explicitly that this an HTML element that should remain intact, but its contents can contain Markdown.

What version of Symphony are you using, and what version of the Markdown text formatter extension?

Is your issue that the content of the textarea is escaped before you do any xslt transformations?

Yes, but as nickdunn points out, HTML and Markdown should be compatible.

What version of Symphony are you using, and what version of the Markdown text formatter extension?

I’m running Symphony 2.0.7 and was running Markdown Text Formatter 1.8. For some reason I thought that was the most recent version when I checked the extension page. Now I see that it’s 1.11.

With 1.8, adding a markdown attribute to my HTML does nothing; it’s still escaped.

Now that I’ve updated the extension to 1.11, HTML still gets escaped using the Markdown, Markdown Extra, and Markdown Extra (with Smartypants) formatters. However, using the Markdown (with HTML Purifier) extension doesn’t escape the HTML.

*Puts a sticky note on his forehead that says, “I will always double check for updates to my extensions.”* Thanks!

So the problem itself is solved, but it still seems weird to me that the other three Markdown formatters escape HTML. Perhaps it’s necessary because if the HTML in the textarea isn’t well-formed (like it is after being run through HTML Purifier), then it’ll break the resulting XML that Symphony generates? But in that case, why not run it through HTML Purifier by default instead of making it an extra text formatter?

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details