jlevy / atom-flowmark

Markdown auto-formatting, beautification, and cleanup for Atom
Apache License 2.0
43 stars 7 forks source link

Cleanup option: Move footnotes to follow punctuation #60

Closed jlevy closed 2 years ago

jlevy commented 3 years ago

In traditional typography, footnotes should trail punctuation (comma, period, semicolon, quote, etc.). But often they are placed before the punctuation in source files.

A special menu item to move footnotes after punctuation would be helpful for enforcing consistency.

const TRAILING_PUNCTUATION_REGEX = /^[,.;:’”'"]+/i;
wooorm commented 3 years ago

here’s how it’s done in genbook, albeit on the final AST where this would work on mdast. https://github.com/feynmanlabs/genbook/blob/master/lib/hast-util-shift-superscript.js#L17