Kunde21 / markdownfmt

Like gofmt, but for Markdown.
MIT License
55 stars 7 forks source link

Support changing emph and strong tokens #47

Closed abhinav closed 1 year ago

abhinav commented 1 year ago

markdownfmt always uses * and ** for <em> and <strong> text. This adds support for changing the emphasis and strong tokens used by markdownfmt.

By default, the emphasis token is '*'. This may be changed with WithEmphasisToken. By default, the strong token is the emphasis token repeated twice. This may be changed with WithStrongToken.

So this supports a few varying configurations depending on user preference.

.===============================.
|    OPTIONS    |    ACTUAL     |
|------+--------|------+--------|
| emph | strong | emph | strong |
|======|========|======|========|
| nil  |  nil   | '*'  |  "**"  |
| '_'  |  nil   | '_'  |  "__"  |
| nil  |  "__"  | '*'  |  "__"  |
| '_'  |  "**"  | '_'  |  "**"  |
'==============================='

Resolves #34