Skip to content

Commit

Permalink
fixup! Add anchor links to headings
Browse files Browse the repository at this point in the history
  • Loading branch information
victorlin committed Dec 12, 2024
1 parent e52d358 commit ac19562
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion static-site/app/blog/parseMarkdown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,14 @@ allowedTags.push("pattern", "polygon", "polyline", "radialGradient", "rect", "se
allowedTags.push("text", "textPath", "title", "tref", "tspan", "use", "view", "vkern");

const allowedAttributes = ['href', 'src', 'width', 'height', 'alt'];
// We add the following Attributes for SVG via https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute

/* "style" is not safe for untrusted code¹, but our own blog post content can be
* considered safe.
* ¹ https://stackoverflow.com/a/4547037/4410590
*/
allowedAttributes.push("style");

// We add the following Attributes for SVG via https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute
allowedAttributes.push("accent-height", "accumulate", "additive", "alignment-baseline", "allowReorder", "alphabetic", "amplitude", "arabic-form", "ascent", "attributeName", "attributeType", "autoReverse", "azimuth");
allowedAttributes.push("baseFrequency", "baseline-shift", "baseProfile", "bbox", "begin", "bias", "by");
allowedAttributes.push("calcMode", "cap-height", "class", "clip", "clipPathUnits", "clip-path", "clip-rule", "color", "color-interpolation", "color-interpolation-filters", "color-profile", "color-rendering", "cursor", "cx", "cy");
Expand Down

0 comments on commit ac19562

Please sign in to comment.