Hi cflow

Firstly, that's an ingenious solution: as you probably discovered you can't
usefully style the <br> element with CSS, but <hr> makes a lot of sense as
a substitute.

Secondly, to answer your original question, the reason that it's not easy
to change the TiddlyWiki wikifier to emit <p>'s instead of <br>'s is just
to do with the way that the code is written: at the point where the parsing
code encounters the newline it no longer knows the location of the previous
one. It would be possible to fix this by rewriting the wikifier, but back
in 2007/8 we concluded that this couldn't be done without breaking
backwards compatibility.

TiddlyWiki5 does parse paragraphs properly as <p> tags, but is also not
backwards compatible with classic TW syntax.

Best wishes

Jeremy




On Wed, Jun 12, 2013 at 2:13 AM, cflow <[email protected]> wrote:

> Had a quick look and this piece of code seemed to do the replace:
>
> name: "lineBreak",
> match: "\\n|<br ?/?>",
> handler: function(w)
> {
> createTiddlyElement(w.output,"br");
> }
>
> Looks like the specific feature searched on is the "\\n" which would be
> the newline character to find, so the start/end of paragraph search I
> thought was happening, is not :(
>
> So I changed:
>
> *createTiddlyElement(w.output,"**br**"); *
>
> to:
>
> *createTiddlyElement(w.output,"*hr*");*
>
> *
> *
> Then applied some CSS to the ".viewer hr" as it is specifically where I
> want the "hr" tag formatting:
>
> .viewer
> hr{border-style:none;padding-bottom:0.25em;color:#fff;background-color:transparent;}
>
>
> which gave me the desired result of space between paragraphs.
>
> If I want to add a horizontal rule, which I rarely do, I use can use the
> following:
>
> .hrule hr{border-bottom:1px solid red;padding-bottom:0.25em; }
>
> with inline use of the class:
>
> {{hrule{
>
> ----
>
> }}}
>
>
>
> I still would prefer a better solution, but this workaround gets me the
> visible result. I haven't seen any issues so far... ;)
>
> On Wednesday, June 12, 2013 10:15:18 AM UTC+10, cflow wrote:
>>
>> Hi Jeremy,
>>
>> Was this ever resolved?
>> It seems like if it can place <br> in the correct positions then its
>> smart enough to find the start of paragraphs and the end of paragraphs
>> already. I have read a few of the group pages and anything I can find
>> online but it isn't part of the latest TiddlyWiki version.
>>
>> If its smart enough to find the start and end of paragraphs to place the
>> <br> surely it is a minor mod to add the <p> at the start and </p> to the
>> end?
>>
>> What am I missing? If someone can point me to the code that does the
>> search for the start/end of paragraphs I will have a crack :)
>>
>>
>> On Monday, May 21, 2007 9:29:27 AM UTC+10, Jeremy Ruston wrote:
>>>
>>> > Though I guess they'd prefer us donating directly via PayPal
>>> > (http://tiddlywiki.com/#**Donations <http://tiddlywiki.com/#Donations>)
>>> rather than waiting until, someday,
>>> > we can come up with 750 quid for "perishable goods"... ;)
>>>
>>> You're really very kind, and quite right this is a bit of a humdinger.
>>> Martin's implementations of the Mediawiki and Socialtext formatters do
>>> handle <P> tags correctly thouugh (although I believe there are still
>>> some issues in certain edge cases). So I think we're in good shape to
>>> solve this; the problem when we do will no doubt be backwards
>>> compatibility....
>>>
>>> Cheers
>>>
>>> Jeremy
>>>
>>> >
>>> >
>>> > -- F.
>>> >
>>> > >
>>> >
>>>
>>>
>>> --
>>> Jeremy Ruston
>>> mailto:[email protected]
>>> http://www.tiddlywiki.com
>>>
>>>


-- 
Jeremy Ruston
mailto:[email protected]

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/tiddlywiki?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to