Skip to content

Commit

Permalink
escape html in descriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
WaylonWalker committed Dec 3, 2023
1 parent 886a4ec commit 650bc06
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions markata/plugins/auto_description.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
from itertools import compress
from pathlib import Path
from typing import Any, Dict, TYPE_CHECKING
import html

import commonmark

Expand Down Expand Up @@ -87,6 +88,7 @@ def get_description(article: "Post") -> str:
# deduplicate paragraph_nodes based on unique source position
unique_paragraph_nodes = list(compress(paragraph_nodes, unique_mask))
paragraphs = " ".join([p.first_child.literal for p in unique_paragraph_nodes])
paragraphs = html.escape(paragraphs)
return paragraphs


Expand Down

0 comments on commit 650bc06

Please sign in to comment.