php-markdown icon indicating copy to clipboard operation
php-markdown copied to clipboard

Make header level configurable

Open tobiastom opened this issue 12 years ago • 1 comments

I'd like to implement configurable header elements. Inside the class I would introduce a default level 0. This would result in all # headers to be transformed into <h1>.

Setting the initial level to 2 would result all # headers to be transformed into <h3>. Having a level of 2 would create an <h4> tag from ##. Formula would be like <number of header levels> + <initial level>.

I would create a pull request for this if you like the idea.

This seems to be related to michelf/php-markdown#102, but I don't like the idea of defining aliases to each and every header element.

tobiastom avatar Jul 28 '13 16:07 tobiastom

Maybe it would be a better open to pass this level as to transformMarkdown. Creating one Markdown instance and reusing it in different places would be much easier.

tobiastom avatar Jul 28 '13 16:07 tobiastom