When exporting to HTML, is there a way to change when a line is designated as a new paragraph and given the paragraph tags?
For example, if I have a note with the following text:
First paragraph line 1
First paragraph line 2
First paragraph line 3
Next paragraph line 1
Next paragraph line 2
Next paragraph line 3
It will export in HTML as:
<p>First paragraph line 1</p>
<p>First paragraph line 2</p>
<p>First paragraph line 3</p>
<p>Next paragraph line 1</p>
<p>Next paragraph line 2</p>
<p>Next paragraph line 3</p>
What I would like is:
<p>First paragraph line 1
First paragraph line 2
First paragraph line 3</p>
<p>Next paragraph line 1
Next paragraph line 2
Next paragraph line 3</p>
I did take a look at the documentation and I saw the $HTMLParagraphStart/End attributes that you mentioned. However, I don’t think that’s what needs to be modified, but I could be wrong since I’m new to TBX.
I think what needs to be modified is where TBX designates a new paragraph. It looks like it designates a new paragraph at a single newline, but I would like to change it so it designates it at two newlines.
That was going to be my new question: how do we recognize where the paragraph starts?
Short answer: you can’t change this.
Clever answer: you can, if you want! Three ways:
Quick and dirty: Search and replace double newlines with a place marker string — perhaps “•”. Now, replace all remaining newlines with the empty string. Finally, replace your place marker string with a single newline \n.
Less quick, less dirty: Explode your text at double newlines. For the exploded notes, omit paragraph markup entirely, and insert <p> and </p> before and after the text in the template.
Less dirty, arguably: use ctrl-Return to obtain a line break in Tinderbox that is not treated as a paragraph ending for export.
The alternative approach is to use tags in HTML or Markdown. Using <br> over ctrl-return could give you more control down the road as you can use action code to easily remove them later