Description: Importing an HTML file (or inserting a text file that is html) will automatically map <h1>-<h6> tags to Heading 1 through Heading 6 styles. <h6> is the maximum heading in the original HTML spec. It would be really nice if <h7>+ tags could be mapped to Heading 7+ styles. My particular application arises from generating HTML reports from code that will be used in a nice Writer document. If you have all of the styles set up the way you like them, you can import an HTML file and make very pretty documents. Steps to Reproduce: 1. Generate HTML file with <h7> tag 2. Make new Writer document 3. Insert...Text from file... select HTML file from step 1 Actual Results: <h7> tag is stripped and heading is changed to Default style. Expected Results: <h7> tag is mapped to Heading 7 style Reproducible: Always User Profile Reset: No Additional Info: .
A workaround that will get you two extra heading styles is to find another HTML tag that Writer will map to a paragraph style. <pre> maps to Preformatted Text <blockquote> maps to Quotations There are other tags that map to character styles, but those are not helpful. <pre> and <blockquote> can get you up to Heading 7 and Heading 8, but only if you don't use Preformatted Text or Quotations style in your document. * use <pre> in HTML file for Heading 7 * use <blockquote> in HTML file for Heading 8 * Insert...File from text... select your HTML file * Do a global search and replace (ctl+H) in your document. Enable Paragraph Styles option. Select Preformatted Text in Find box and Heading 7 in Replace box. Click on Replace All to replace all instances of Preformatted Text paragraph style with Heading 7 style. * Repeat previous step with Quotations/Heading 8
According to https://www.w3schools.com/html/html_headings.asp, there's no more than H6. So H7 and more aren't standard. IMHO I'd put this one as NOTABUG.
Yes, a tag <h7> is invalid HTML.
I disagree that this is resolved. It's not a big. It's and enhancement request.
I don't consider it as an enhancement either since it doesn't respect HTML standard. => uncc myself.
Maybe someone can suggest another markdown or markup format besides HTML that Writer supports? For me, the whole point of using HTML is to generate professional reports from some kind of relatively simple text file. And inserting an HTML file into a Writer file is like magic: it looks great and the fonts and styles of the parent document are kept. I can process tons of data, make pretty plots in SVG format, insert hundreds of figures into html <img> tags, and import the whole thing into Writer. However, one of the biggest drawbacks to this scheme is the limitation on headings. And the workaround I posted is not that great either. If there was any other way of hinting to Writer what style I would like to use, that would be great. I went through every html tag on W3 Schools and only two tags map (pre and blockquote) to Writer paragraph styles. How would everyone feel about some other mechanism for mapping an html tag to a Writer paragraph style?