Skip to content

Commit

Permalink
[tags-extraction][xs]: Hashtag in inline code incorrectly parsed as a…
Browse files Browse the repository at this point in the history
… tag #106
  • Loading branch information
mohamedsalem401 committed Jan 5, 2024
1 parent bb9ac61 commit 1ea02a1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions __mocks__/content/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,5 @@ Another tag: #태그이름
#
#---------------------------------------------------------------------------------------
```
`#inline-code-tag`
#4874
4 changes: 2 additions & 2 deletions src/lib/parseFile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ export const extractTagsFromBody = (ast: Root) => {
const nodes = selectAll("*", ast);
for (let index = 0; index < nodes.length; index++) {
const node: any = nodes[index];
const textContent = node.value; // extractTextWithoutCodeBlocks(node);
if (textContent && node.type !== "code") {
const textContent = node.value;
if (textContent && node.type !== "code" && node.type !== "inlineCode") {
const textTags = extractTags(textContent);
tags = tags.concat(textTags);
}
Expand Down

0 comments on commit 1ea02a1

Please sign in to comment.