Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/misc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ export const applyRules = (data: string, rules: ApplyRule[]): string => {

/** Removes trailing whitespace before the closing tag of block-level elements (`h1`–`h6`, `li`, `td`, `th`). */
export const trimElementWhitespace = (str: string): string =>
str.replaceAll(/\s+(<\/(?:h[1-6]|li|td|th)>)/g, '$1')
str.replaceAll(/\s+(?=<\/(?:h[1-6]|li|td|th)>)/g, '')

/**
* Walks `tagRe` forward from `start`, tracking open/close depth, and returns the index
Expand Down
Loading