Re: Eric Schulman's HTMLFormatterPlugin

103 views
Skip to first unread message

Eric Shulman

unread,
Apr 23, 2013, 12:50:23 PM4/23/13
to TiddlyWikiDev
> I noticed that it adds an span whenever you have a blank line in the html.

Please read the plugin documentation regarding the handling of
newlines. By default, embedded newlines are treated as TW-formatted
content and are retained in the output. If you don't want newlines to
be retained (i.e., the "normal" HTML handling), then you should be
using the <hide linebreaks> "psuedo-tag" within your HTML:

<html><hide linebreaks>...mixed HTML and TW-formatted content here...</
html>

Alternatively, if you are not using any TW syntax within the HTML, you
can use the <nowiki> psuedo-tag:

<html><nowiki>... HTML content only ...</html>

Please note: if you change my plugin code, you MUST rename your copy
of the plugin to avoid confusion. Please see http://www.TiddlyTools.com/#LegalStatements
for further information regarding terms of use.

-e


Sam Drost

unread,
Apr 23, 2013, 1:11:52 PM4/23/13
to tiddly...@googlegroups.com
I had the newlines hidden by putting config.options.chkHTMLHideLinebreaks=true; in a tiddler with the "systemConfig" tag. It still creates empty spans when it encounters newlines. This throws off the :last-child selector unless you have no newline between the last element and the "</html>" tag in the tiddler (actually further testing shows that any sort of whitespace, not just newlines will create an empty span element). Normally the empty span wouldn't be a big deal or even noticeable, I only noticed it because of the css I'm using.

Thanks for informing me of the legal statements, I wasn't aware of that little caveat and will be sure to rename my version of the plugin.

Sam Drost

unread,
May 2, 2013, 8:14:34 AM5/2/13
to tiddly...@googlegroups.com
I have uploaded a tiddlywiki with my customized version of the HTMLFormatterPlugin and a customized version of the SectionLinksPlugin that adds support for scrolling to any element that matches a specific id since that matches the html specification (http://www.w3.org/TR/html4/struct/links.html#h-12.2.3). If you want to look at them, I have hidden all my plugins as well as the systemConfig tag itself in the excludeLists tag.

Måns

unread,
May 3, 2013, 5:42:27 PM5/3/13
to tiddly...@googlegroups.com
Hi Sam

Nice theme :-)
Thank you for sharing it here.

I like it so much that I've embedded all fonts and images as binary data - 
My theme copy is therefore a single TW ( 679 kb) not depending on any external files.

Cheers Måns Mårtensson

Sam Drost

unread,
May 3, 2013, 9:42:10 PM5/3/13
to tiddly...@googlegroups.com
Hey, that's pretty cool. I'm still fiddling with the theme a bit, but I'll let you know as I get more done.
Reply all
Reply to author
Forward
0 new messages