Hex Color Values in CSS Files Mangled by Insert CSS File

Viewed 5

Description

When Insert CSS File injects a CSS file's contents, Marked's tag processor
incorrectly runs over the CSS content and wraps hex color values in
<span class="mkstyledtag"> elements, completely breaking the CSS.

Steps to Reproduce

  1. Create a CSS file containing hex color values, e.g.:
.kriah-ornament {
  color: #8B6914;
}
  1. Add an Insert CSS File action pointing to this file
  2. Preview or export the document
  3. Inspect the injected CSS

Expected Behavior

CSS contents should be injected verbatim without any processing.

Actual Behavior

.kriah-ornament {
  color: <span class="mkstyledtag">#8B6914</span>;
}

The # character in hex colors is being interpreted as a Marked styled tag,
breaking every color declaration in the file.

1 Answers

This is a valid issue. You can temporarily work around it by turning off "#text is tag" in Processor settings. I'll fix this today, though.

This was a relatively easy fix and will be included in a release today (it won't be in the MAS version for a while, but Setapp and Paddle versions will be out today).