telesoho / vscode-markdown-paste-image

Smartly paste for Markdown.
MIT License
138 stars 41 forks source link

header style: atx for h1, h2, ...? #130

Open ruleset opened 4 months ago

ruleset commented 4 months ago

is there a way to cause Markdown Paste to always use atx style headings? maybe there is a rule regex? or a toggle?

thanks!

when I paste formatted html using markdown paste, I get setext style for the first two levels.

Header 1
========

Header 2
--------

### Header 3

#### Header 4

##### Header 5

###### Header 6

The desired paste result would use ATX style headings.

# Header 1

## Header 2

### Header 3

#### Header 4

##### Header 5

###### Header 6

https://www.markdownguide.org/basic-syntax/#headings

I searched for vscode configurations, lint correctors, etc.

Hash-style headings would be consistent and avoid lint messages such as the following. MD003/heading-style: Heading style [Expected: atx; Actual: setext]markdownlint[MD003]

telesoho commented 4 months ago

@ruleset

You can use MarkdownPaste.turndownOptions in vscode setting like this.

  "MarkdownPaste.turndownOptions": {
    "headingStyle": "atx",
    "bulletListMarker": "-",
    "strongDelimiter": "**",
    "emDelimiter": "*",
    "preformattedCode": "true",
    "hr": "\n\n* * * *\n\n"
  }