@BLUEFROG While the SED approach above works pretty good, I’ve run into a few problems - which I suspect you were alluding to previously.
The principal issue has to do with how the span tags are closed (
</span>). I didn’t realize until I started poking around with the HTML that once you “edit” a formatted note in DTTG - for example, by adding text, like HIGHLIGHTSTARTYELLOW or HIGHLIGHTENDYELLOW - that DTTG often modifies the paragraph’s surrounding tags, too.
For example, when I add the text “HIGHLIGHTSTARTYELLOW” and “HIGHLIGHTENDYELLOW” to some text in a paragraph which is surrounded with the usual HTML
<p> </p> tags.
<p> Text Text Text Text Text Text </p>
DTTG will modify those tags to and add a bunch of extraneous stuff:
<p dir="auto" class="p1"><span class="s2"> Text HIGHLIGHTSTARTYELLOW Text Text Text Text HIGHLIGHTENDYELLOW Text </span></p>
You can see it in the header of the document, too.
So, now when I run the SED script in DEVONthink Pro, I sometimes wind up with issues in the formatted note when the highlighting runs across more than one paragraph, etc. - where substituting a close span tag
</span> might refer to something else.
1 - Is it possible to edit a formatted note in DTTG without it adding all that styling garbage (i.e., an existing note, not a new one)? In other words, can I just add text in the middle of a
<p> without it adding all of the inline or header stuff? I’d prefer for the default to just follow the existing HTML tags. Then, if the user wants, they can format it differently - which would necessitate all the extra stuff.
2 - Assuming the first is not possible, is it possible to close a specific span tag via HMTL? I apologize if this is a stupid question, but I’m not great with HTML and after a ton of internet searching, I still can’t figure out how to even ask the question coherently? Put differently, is it possible to add an ID/Class/Something to the span style, so that when I use
</span> to close it, that it won’t close other inline styles that rely on the span tag, too? Feel free to laugh at this, but something like
</span 1 or 2 or whatever>.
As always, thanks for your help!