Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2009-10-01 02:34:45

ax
Plugin Author
From: Germany
Registered: 2009-08-19
Posts: 165

[textile] Markdown and underscores

Having replaced Textile with PHP Markdown Extra there is a problem with the textpattern tags. Tags like <txp:image id=“42” /> are parsed, but tags like <txp:site_name /> that have an underscore are not. Any ideas how to deal
with this?

Offline

#2 2009-10-01 11:17:22

jsoo
Plugin Author
From: NC, USA
Registered: 2004-11-15
Posts: 1,793
Website

Re: [textile] Markdown and underscores

You mean they are parsed when you save the article, and stored as HTML? Making the tags static rather than dynamic? Or do you mean the tags with underscores are getting mangled?


Code is topiary

Offline

#3 2009-10-01 11:33:23

ax
Plugin Author
From: Germany
Registered: 2009-08-19
Posts: 165

Re: [textile] Markdown and underscores

Txp-Tags with underscore in an article appear as such in the page, but txp-tags without an underscore produce the desired result. Obviously, the fault is not with Textpattern, but with PHP Markdown, but I thought that someone might have solved it.

Offline

#4 2009-10-01 14:55:29

ax
Plugin Author
From: Germany
Registered: 2009-08-19
Posts: 165

Re: [textile] Markdown and underscores

Michel Fortin, who is the author of PHP Markdown Extra, has provided the following solution:

In function `parseSpan` change line 1542 (or a line near that number) which looks like this:

<[/!$]?[-a-zA-Z0-9:]+ # regular tags

to this one (note the added underscore):

<[/!$]?[-a-zA-Z0-9:_]+ # regular tags

Offline

Board footer

Powered by FluxBB