mirror of
https://github.com/saicaca/fuwari.git
synced 2026-01-13 07:42:52 +01:00
fix: biome linter error (#369)
* fix(remark-excerpt): change loop variable to const for better readability * fix(rehype-component-github-card): correct string quotes for consistency in title element * fix(remark-directive-rehype): update biome-ignore comment for clarity on linting rule * fix(rehype-component-admonition): use optional chaining for properties check and improve formatting * fix(Pagination): improve equality checks and enhance code readability * fix(TOC): correct equality check for consistency in removeTailingHash function * fix(ImageWrapper): update import path to use 'node:path' for consistency * fix(PostCard): update import path to use 'node:path' for consistency
This commit is contained in:
committed by
GitHub
parent
c106a639f4
commit
b016bd096c
@@ -1,10 +1,11 @@
|
||||
// biome-ignore lint/suspicious/noShadowRestrictedNames: <explanation>
|
||||
import { toString } from 'mdast-util-to-string'
|
||||
|
||||
/* Use the post's first paragraph as the excerpt */
|
||||
export function remarkExcerpt() {
|
||||
return (tree, { data }) => {
|
||||
let excerpt = ''
|
||||
for (let node of tree.children) {
|
||||
for (const node of tree.children) {
|
||||
if (node.type !== 'paragraph') {
|
||||
continue
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user