Search

A new XSLT utility, “HTML To Markdown Text” is now available for download. Comments and feedback can be left here but if you discover any issues, please post it on the issue tracker.

@michael-e, would you mind providing an example on how to use this utility?

Well, basically it's an idea that I came up with originally and Michael perfected. It's Allen's Ninja Technique taken to its wild conclusion: If XSLT can transform XML into almost anything, it should be able to take XHTML and turn it into Markdown syntax.

At one time, this was a necessary step, because there was no way in front end forms to convert the formatted HTML created with the Markdown extension back to Markdown syntax. So, it was necessary to parse the HTML output to recreate the original Markdown. My version didn't take into account all cases, but I think Michael was able to track down most, if not all possibilities.

But since text areas can now be output as formatted or unformatted, there is no longer an issue. Except in your case, where there is no unformatted text.

You could set up a front end form, similar to the Import page of the DesignProjectX ensemble. For the text areas, you could import the HTML to Markdown utility:

<xsl:import href="../utilities/html-to-markdown.xsl"/>

Then use the Ninja Technique to apply the template to the textarea fields of your section entries.

You can see how the DesignProjectX entries can be viewed with the HTML to Markdown utility as plain text.

@bauhouse - Thanks for the input. This is very helpful!

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