danschultzer / premailex

Preflight for your HTML emails - inline styling and plain text.
MIT License
170 stars 19 forks source link

Selectors with escaped commas are parsed incorrectly #76

Closed jdav-dev closed 1 year ago

jdav-dev commented 1 year ago

Selectors with escaped commas are split on the escaped comma:

Actual:

iex> Premailex.CSSParser.parse(".with\\,escaped\\,commas {}")
[
  %{rules: [], selector: ".with\\", specificity: 1},
  %{rules: [], selector: "escaped\\", specificity: 1},
  %{rules: [], selector: "commas", specificity: 1}
]

Expected:

iex> Premailex.CSSParser.parse(".with\\,escaped\\,commas {}")              
[%{rules: [], selector: ".with\\,escaped\\,commas", specificity: 1}]