Issues in Generating Extra <p> Tag in Tiddlywiki

This is a rather ancient issue, generating extra and extra and extra <p> tag when Tiddlywiki renders thing!

May daily users who just use TW to write simple notes and create lists or simple ui elements like a select (drop down list) or an input will not encounter this issue, but when you want to design something deal with little more ui elements you have unexpected issues which take you a lot of time!

There are many issue reporting on GitHub address this, but still not resolved! I raised this issue here to

  • know others experiences
  • know temporarily solutions

and invite super users / developer to address this issue!

Can you illistrate this problem you percieve please. As noted it is a faily broad issue and in many cases we now have effective solutions. But i am not sure to what you refer.

One example is trying to styles child/target elements and sibling css selectors!

have a look at GitHub repo page and see numbers of reported issues like

I think the main reason, why PR 4290 hasn’t been merged is this comment: Improve p generation by nilslindemann · Pull Request #4290 · Jermolene/TiddlyWiki5 · GitHub and

… In the case of this PR, things change a lot (e.g. all the new trailing backslashes).

from an earlier comment from Jeremy.

So if the PR would be “pushed” a bit at GitHub it may help.

1 Like

Thanks Mohammad,

I am not sure how I can contribute given the depth into the core. However I can add a little to the issues below;

I am trying to be helpful and share another view.

  • Would it hurt providing a feature in the export templates to help with static html, after all the templates are bespoke for exporting static html anyway. eg remove wayward paragraph tags.
  • Aspects of this have raised their head many times but various approaches have being developed to address them. For one the idea of the dot paragraph which has resulted in the paused but live custom wiki-text plugin with Mario, this could possible help at least with a class of these issues if not all.
  • I am currently investigating the idea that the text field is just that, some text. and looking at applying custom templates basically because the view templates application of $:/core/ui/ViewTemplate/body is actually just a transclusion (without templates).
  • Recent talk about programmatic way of hiding the body text has led me to play with ideas stemming from The quickest and easiest ever todolist in tiddlywiki ? Requires 5.2.0 - #2 by TW_Tones in that case I interpret the text differently - ie each line without wiki markup is a todo Item and can be made into a field or tiddler. Although it also depends on wiki markup and its peculiarities, I just apply a specific set to suit the outcome I want. Basically I redefine what the text field means. I could see someone writing other viewTemplates that transform the text into any desirable form.
  • A the very same time with the ability to edit the current tiddler in 5.2.0 I can see how we could apply alternatives such as for form handling, whist you can just build a sophisticated view template, you could just apply a different form or hand made parsing regime. Then the only code needed can come from that interpretation of the text field.
  • Just a final note, when dealing with this the core internals plugin is a great help using the html preview. Because you can get immediate feedback on what the parser generates.

Remember I try to be a supper user who does not resort to javascript and core changes, from my perspective we could easily accommodate different results, all that remains is to get the various shorthand transclusions to detect an alternate template is available and use that when transcluding one tiddler from another. This can be done manually already.

One other final approach may be to open up or extend the existing type field to accept user types. Detecting when they are not also mime types, or creating new mime types. For example using this for other markups.

It seems to me we could add features rather than risk the core changes.

@TW_Tones
I will return to this later to discuss with you! but for short answer, this p generation cause difficulties in developing styles! I do not say it is not possible with current rendering, but this will be

@Mohammad sure, I think understand your interest now, somewhat at least.

Given Marios custom wikitext allows you to apply html tags to textural content (inline or block), I think it will be able to provide an adequate workaround (in part because we were coming at the paragraph issue from another direction). However I would still support the idea of the resolution of the original problem because workarounds are only second best.

Not really. It should be fixed in the core.

Mario. That is also what i said.