View Single Post
EightBitz
Senior Member
 
Join Date: May 2013
Posts: 1,458

Old January 17th, 2017, 06:02 AM
Quote:
Originally Posted by davidp View Post
The <contents> of a <snippet> should all be HTML and that would be the only place that the lists, tables, etc. would be present. You should be able to take the <contents> and just treat it as HTML and be done with it. Any more and you are making life hard on yourself.

The only slight gotcha is that we use encoding of the contents so that it isn't interpreted as XML tags, but that should be straight-forward to deal with.
Nope, I still have to tear things apart for HTML. There's another gotcha.

I'm adding an option to indent nested topics and sections. And it works great for everything except tables. Mind you, I'm still very much an amateur coder, but here's basically what's happening.

In order to indent blocks of text, and not just the first line, I'm using margin-left. For pre-formatted HTML text in the contents node, I'm inserting it right after the "<p " tag. And I add it to every instance, otherwise only some parts of some snippets will indent, and the rest will not.

Adding it to every instance of <p means it's also adding the margin to the table cells.

I could just write code that says if this snippet includes a table tag, then don't insert a margin, but if I have a combo snippet with text and lists and tables, that's not going to work.

So I have to divide things up into components again so I can have better control of where I insert the margins.

The GOOD news is that I already have that code. :-)

The bad news is that I've been up all night, and I'm tired.

But the GOOD news is that everything else is looking good, and this is hopefully the last thing I have to tackle.

The bad news is that I can't do it right now.

But the GOOD news is that ... uhhh ... oh, never mind.
EightBitz is offline   #10 Reply With Quote