≡

wincent.dev

  • Products
  • Blog
  • Wiki
  • Issues
You are viewing an historical archive of past issues. Please report new issues to the appropriate project issue tracker on GitHub.
Home » Issues » Feature request #1237

Feature request #1237: Auto-adjust "heading level" according to context

Kind feature request
Product wikitext
When Created 2009-02-22T18:54:18Z, updated 2009-03-02T05:56:24Z
Status closed
Reporter Greg Hurrell
Tags no tags

Description

It would be nice if you could do something like this:

>> parser.base_heading_level = 0 # 0 would be the default
>> parser.parse "= Hello ="
=> "<h1>Hello</h1>\n"
>> parser.base_heading_level = 2
>> parser.parse "= Hello ="
=> "<h3>Hello</h3>\n"

In other words, you could indicate to the parser what the context was, so that it could choose the appropriate heading level automatically, without you having to think "well, I am writing a blog post excerpt, so I've probably already got an <h1> and an <h2> element above me, so I should start at <h3>"; you could just always use <h1> for your top-level heading and not worry about it.

If you started with a base level of 2 or 3 and tried to use <h6>, the parser would just emit <h6> rather than invalid <h8> or <h9>.

Comments

  1. Greg Hurrell 2009-02-22T18:54:42Z

    Status changed:

    • From: New
    • To: Open
  2. Greg Hurrell 2009-03-02T05:56:12Z

    This feature was added (released in Wikitext 1.5.0).

  3. Greg Hurrell 2009-03-02T05:56:24Z

    Status changed:

    • From: Open
    • To: Closed
Add a comment

Comments are now closed for this issue.

  • contact
  • legal

Menu

  • Blog
  • Wiki
  • Issues
  • Snippets