HTML handling in SuperRedCloth


#1

I’m having all kinds of fun trying to get HTML to work “properly” in
SRC (mild sarcasm). I’m still working on the problem, but wanted to
run it by the group.

Currently, Textile2 lets you put in HTML as long as it’s in the same
block (i.e. no double-returns).

  • You can put HTML code right in Textile.
  • It will not insert a break between elements
  • or wrap it all in a p tag.

But it won’t let you

This is one paragraph.

This is another.

becomes

This is one paragraph.

This is another.

I think SRC should support this (I see it as pretty essential to the
proper working of my CMS), but it’s turning out to be a tough pattern
to code! I had something I thought was working pretty well, but then
Johan Sørensen pointed out a problem if you have something like
asd blabla or indeed even something. SRC needs to
be smart enough to know that EM tags need to be within P tags, but
not to wrap LI tags in P tags. And do things in DIV tags always need
to be in Ps?

sometext
is perfectly valid, too.

I’ll keep working on it, but if you have thoughts on the subject,
please share them!

Jason G.