Search

I’m using the Alistair’s Markdown extension for my articles, and when I tab the code block the output code on my page is correctly wrapped in the pre and code tags, but there are several tabs between the 2 tags. This is resulting in the first line of the code being indented several tabs more than the rest.

I had a look in the markdown PHP class, and the code appears to be outputting the 2 tags next to each other, so my next line of thought is that my XSLT is doing something wrong.

Does anyone have any ideas what might be happening here?

The code is correctly pre and code tag wrapped and indented except for the first line.

Have you tried to manipulate the output while processing it in your XSL templates? You could use Allen’s ninja technique to match the pre elements and rebuild the inner content without the extra text nodes.

Have you tried to manipulate the output while processing it in your XSL templates? You could use Allen’s ninja technique to match the pre elements and rebuild the inner content without the extra text nodes.

Thanks Nils that worked a treat. I’ll do a bit more playing with this technique as there must be a hundred uses for it.

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