Need macro to italicize all text between <i> and </i>
My genealogical program can output rich text , using xxx and yyy for italics. I wish to italicize the marked passages in large documents once I;ve loaded them into LibreOffice Writer.
xxx and yyy use angle brackets i and angle brackets /i which I don't seem to be able to reproduce in this forum.
The documents are in rich text format, not HTML. Here is an example: "the passenger manifest of the S.S. Batavia out of Hamburg."
Really RTF (Rich Text Format) or HTML?
Tell us more about your goal. If your genealogical program outputs HTML, it is more simpler to open this HTML file with Writer (procedure depends on OS which you didn't mention, usually based on a right-click on the file icon). Once in Writer,
File
>Save as
in .odt format does the trick.Please do not use Add Answer but edit your original question to enhance the details of your question (answers are reserved for solutions to a problem on this Q&A site).
Are you aware that the W3C Web Accessibility Initiative (WAI) standards recommend using em and /em instead of i and /i. (Sorry that I can't put my finger on the exact document at the moment.) Many web accessibility testing tools will flag your use of i and /i as a violation. (Angle brackets omitted because it confuses the formatting here.)
I'm not interested in web accessibility. I just want to print out the documents on paper with the marked sections properly italicized.
... meaning emphasized. I think current aemphsizing mode can be italic, but isn't explicitly specified this way.
See https://www.w3schools.com/html/html_f....
If the document is truly RTF, open it directly in Writer (eventually give it extension .rtf but this is not strictly necessary). Writer has an input/output filter to import/export RTF files. But be prepared for some errors if your genealogical program uses a different version of RTF specification.
Thank you. I experimented by opening the file as RTF and writing it out as ODT. It didn't work, but I may not have attended to the filters you mention. I think the macro supplied by Lupp will do the job.
Thanks to all.
"I'm not interested in web accessibility."
Sorry, I thought your intention was to post your genealogy data on the web. My mistake.
I do, but via a different route. I use John Cardinal's GedSite program; see example at https://genarchives.com/NineGeneratio... (he said proudly) :-)