Ciao TonyM

I followed your several forays on this issue with great interest.

I want to make a few points that are about what I think is a common problem 
(this is much of your issue, though does not embrace everything)

1 - when you cut and paste into TW some plain text there is NO way of 
determining IF ...

Am I seen
as a line?


OR ...

Am I a paragraph 1 or just a sentence in a paragraph?
Am I paragraph 2 or just a sentence in paragraph 1?



2 - IF you copy-paste / import arbitrary text a lot wonderings may arise a 
lot too.

The solutions under discussion are focused on various solutions to the 
issue, but they are not facing* the fundamental indeterminacy of (1)*.

FWIW, I can see merit in a "Content-Type" that is a *converter*. That 
specialises in CONFORMING arbitrary paragraphing to a TW standard by 
permanent changes to initial input data paragraphing. As soon as its done 
you switch Content Type to what you need standard.

IMO the approach to hack dynamic parsing to address the issues is over 
complicated. Better to put effort into permanently conforming input text to 
TW para conventions which work.

Best wished opinion :-)
TT


On Wednesday, 13 May 2020 04:02:24 UTC+2, TonyM wrote:
>
> Folks,
>
> I just found a solution to an issue which bugs a lot of new and 
> experienced users alike, many come to be happy by adapting to it, however 
> when they bring text in from elsewhere the issue rears its head again.
>
> *[Edit] This lead thread is soon to be updated with information from 
> replies, read the whole thread before deciding if this is for you until 
> then. The Retain call on text you want to retain formatting, in should be 
> fine, but only use simple markup there until I update: Thank you.*
>
> *Problem:* Consider Source Text as follows in a tiddler 
> line a
>
> line b
> line c
>
>
> Line d
>
> Gets displayed as
> line a
>
> line b line c
>
> Line d
> That is the author or source of text requires two enters resulting in a 
> blank line before it is treated as a new paragraph, other wise the line is 
> appended to the previous line.
>
> See also that the source text has two line between line c and line b, yet 
> rendering collapses this to one line, this will not change with this 
> solution
>
> Be aware there are good reasons for this behaviour and attempts at fixing 
> it have tended to be cumbersome.
>
> As I posted in this thread Preserving paragraphs when pasting into TW 
> <https://groups.google.com/d/msg/tiddlywiki/TX1VfRRFmhE/qzhN7TePBQAJ> (answer 
> reproduced here) I think I have found a useful solution that can be applied 
> in a few different ways.
>
>
>    - This solution also allows wikitext markup to be applied to pasted 
>    text, allowing subsequent markup.
>
> *Additional solutions have being Identified*
>
>    - Marios solution 
>    <https://groups.google.com/d/msg/tiddlywiki/tXYXdvk3VXI/-hXIlzWuBQAJ> 
>    uses a Tag to indicate tiddlers needing hard line breaks (Mat also 
> supports 
>    the tag approach) 
>       - Use this for whole of tiddler applications
>    
> *Notes*
>
>    - pre-wrap; The below examples have being updated to *use the pre-wrap* 
>    (not a simple pre) to cover more cases correctly (Thanks Riz)
>    - I want to point out my whole of tiddler solution 3, using class, 
>    solution is only applying this to html p or paragraph elements generated 
> by 
>    tiddlywiki, 
>    - Preview will not necessarily reflect what happens with whole of 
>    tiddler solutions
>
>
> *Background 1st solution*
> If you wrap a block of text in a section or other html blocks and use a 
> style to use the same white spacing as pre you will get text that behaves 
> like was intended in the source text.
> Using a blank line after the first html tag ensures any wikitext markup is 
> honored.
>
> <section  style="white-space: pre-wrap;">
> blank line here
> !Marked
>
> Your pasted text Wikitext markup if desired
> </section>
>
> *2nd Solution*
> Of course you can create a css class eg "retain" and apply it like this as 
> well (define in a tiddler tagged $:/tags/Stylesheet
> eg
> .retain { white-space: pre-wrap; }
>
>
> @@.retain
> ;No Blank line needed for wiki text
> Some text
>
> some more text
> @@
> You can leave off the closing "@@" with no apparent ill effect
>
>
>    - The above is honored when transcluding this tidder
>
> *3rd Solution*
>
> There may be better ways but if on a given tiddler you wish to have a 
> class applied to the whole content create a class field and give it the 
> value of the class in the following format.
>
> class=classname and the whole tiddler content will have class applied
>
> However the class is applied at the very last moment, so the preview 
> window does not apply it, and the rendered tiddler is wrapped in one or 
> more `<p>` tags.
> So let us define a class that uses the P selector to target the resulting 
> paragraphs
> .keep P { white-space: pre-wrap; }
>
> and set the class field to keep
>
> So the whole tiddler will honor this formatting, good for pasted content 
> with line breaks considered paragraph breaks, and still permits wikitext.
>
>    - In this case unlike 1st and 2nd solutions this class is not honored 
>    in transclusions, which may a be good or bad 
>    - Use this to fix it, ie add the retain class to the section
>
> @@.retain {{transcluded}}@@
>
> *In closing*
> Some of us may consider this a substantial improvement in usability others 
> will see little or no value.
>
>    - What do you think?
>    - Have you other ideas?
>    - Feedback please
>
> Regards
> Tony(m)
>
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/0433a3f2-b690-4c38-a0b9-ec431eb1b2bb%40googlegroups.com.

Reply via email to