Problem/Motivation

By default the html-to-markdown library outputs H1 as double underlined, H2 as single underlined, and H3 and following in the usual ### Title notation. This is a curious choice and contravenes most current use of Markdown by techwriters. It would be cleaner and better aligned with current MD use to output all headings with hashes preceding the title text.

Steps to reproduce

Request any node with one of the currently supported methods.
Note output style.

Proposed resolution

Set header_style to 'atx' in the options instead to output all headings with hashes preceding the title text.
https://github.com/thephpleague/html-to-markdown?tab=readme-ov-file#styl...
$converter = new HtmlConverter(array('header_style'=>'atx'));

Remaining tasks

Change the output options to include atx header choice.

User interface changes

none

API changes

none

Data model changes

none

Comments

christophweber created an issue. See original summary.

  • i'mbatman committed ccd9ba63 on main
    Issue #3512564: Set header_style to 'atx' in the options
    

christophweber’s picture

Version: 1.0.x-dev » 1.0.0-rc3
Status: Active » Fixed

This now works as requested. Our techwriters are a whole lot happier now!

imbatman’s picture

Status: Fixed » Closed (fixed)
imbatman’s picture