bobheadxi / readable

👓 Opinionated Markdown formatter, featuring semantic line breaks
https://bobheadxi.dev/semantic-line-breaks/
20 stars 4 forks source link

reflow: look-ahead for breaking decisions #1

Closed bobheadxi closed 3 years ago

bobheadxi commented 3 years ago

theres still a fault in the heuristic where we don't break on every sentence, just those that aren't wicked short. however, if we get a short sentence followed by a long boi you get two super long sentences:

deno run readable-demo.ts fixture2
# Document

hello world! this is a document. here is a sentence.
and here is another `sentence`! with a [a link](https://bobheadxi.dev) and **emphasis [bold link](https://github.com/bobheadxi)** and *italics* and ~~strike~~ and a ![cute image](https://bobheadxi.dev/assets/images/profile.jpg).

should be:

# Document

hello world! this is a document. here is a sentence.
and here is another `sentence`!
with a [a link](https://bobheadxi.dev) and **emphasis [bold link](https://github.com/bobheadxi)** and *italics* and ~~strike~~ and a ![cute image](https://bobheadxi.dev/assets/images/profile.jpg).
bobheadxi commented 3 years ago

Fixed as of https://github.com/bobheadxi/readable/tree/v0.2.0