mirror of
https://github.com/danog/sass-site.git
synced 2024-11-30 04:29:17 +01:00
Preserve whitespace during HTML truncation (fixes code blocks).
This commit is contained in:
parent
a3f0ea2af5
commit
f21dd48def
@ -32,7 +32,7 @@ export const getLorem = (type: string, number = 1) => {
|
||||
* @see https://github.com/oe/truncate-html
|
||||
*/
|
||||
export const truncateHTML = (html: string, words = 170) =>
|
||||
truncate(html, words, { byWords: true });
|
||||
truncate(html, words, { byWords: true, keepWhitespaces: true });
|
||||
|
||||
/**
|
||||
* Renders block of Markdown into HTML.
|
||||
|
Loading…
Reference in New Issue
Block a user