Skip to content

Fixes issues with cleaning broken Markdown blocks and reduce words to…#142

Merged
Alteras1 merged 2 commits intomainfrom
fix/md-blocks-splitting
Mar 18, 2025
Merged

Fixes issues with cleaning broken Markdown blocks and reduce words to…#142
Alteras1 merged 2 commits intomainfrom
fix/md-blocks-splitting

Conversation

@Alteras1
Copy link
Contributor

… lines

BBob updated to form tree by word instead of linebreak. Reconstructs consecutive strings to form lines so that line break plugin operates properly.

Before:
Pasted Graphic 1

After:
Pasted Graphic 2

… lines

BBob updated to form tree by word instead of linebreak. Reconstructs consecutive strings to form lines so that line break plugin operates properly
Copy link
Contributor

@MShultz MShultz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have any concerns for this added processing step on larger posts?

@Alteras1
Copy link
Contributor Author

Do we have any concerns for this added processing step on larger posts?

It could take quite a bit of added time since the code in its current form is doing repetitive string concatenation and building a new array before splicing it in place. It might be better to do the whole operation in place using only moving window indices to avoid new array/string creation, but my brain was pretty fried by the time I found this bug. Feel free to make a change or let me know if you feel it would be worth it.

@Alteras1
Copy link
Contributor Author

I've updated the function to use a moving index window to minimize string concatenation and array sizing. Should be better, but haven't performed any benchmarking to confirm.

@Alteras1 Alteras1 merged commit 6c422e5 into main Mar 18, 2025
3 checks passed
@Alteras1 Alteras1 deleted the fix/md-blocks-splitting branch March 18, 2025 17:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants