Update regexes with u option
And add pw validations
This commit is contained in:
@ -63,7 +63,7 @@ defmodule Outlook.HtmlPreparations.HtmlPreparation do
|
||||
|
||||
def set_sibling_with([ node | rest ]) do
|
||||
sib_with = case node.type do
|
||||
:text -> Regex.match?(~r/^\s*$/, node.content) && :both || :inline
|
||||
:text -> Regex.match?(~r/^\s*$/u, node.content) && :both || :inline
|
||||
:comment -> :both
|
||||
end
|
||||
[ %InternalNode{ node | eph: %{sibling_with: sib_with} } | set_sibling_with(rest) ]
|
||||
@ -73,7 +73,7 @@ defmodule Outlook.HtmlPreparations.HtmlPreparation do
|
||||
|
||||
|
||||
def strip_whitespace_textnodes [ %{type: :text} = node | rest] do
|
||||
if Regex.match?(~r/^\s*$/, node.content) do
|
||||
if Regex.match?(~r/^\s*$/u, node.content) do
|
||||
strip_whitespace_textnodes(rest)
|
||||
else
|
||||
[ node | strip_whitespace_textnodes(rest)]
|
||||
|
||||
Reference in New Issue
Block a user