I know that you know :D
|
if (head.lang) { |
|
// TODO: This removes any existing attributes, but merging them without |
|
// a proper HTML parser is way too error prone. |
|
html = html.replace(/(<html(\s[^>]*?)?>)/, `<html lang="${enc(head.lang)}">`); |
|
} |
...but I just wanted to file an issue so that this problem isn't "forgotten" due to other development priorities.
My workaround for this bug is to not set lang in head, and to supply the attribute directly in index.html (alongside the other attributes I need, notably dir="ltr"). There are of course other possible workarounds, such as setting dir="ltr" on body instead, but I have other attributes on the html root element which are used to enforce CSS specificity (notably: id).
So for me this is not a deal breaker as I can just set all required attributes statically in index.html, but this could be problematic for other devs.
I know that you know :D
wmr/packages/wmr/src/lib/prerender.js
Lines 203 to 207 in 00ed4e1
...but I just wanted to file an issue so that this problem isn't "forgotten" due to other development priorities.
My workaround for this bug is to not set
langinhead, and to supply the attribute directly inindex.html(alongside the other attributes I need, notablydir="ltr"). There are of course other possible workarounds, such as settingdir="ltr"onbodyinstead, but I have other attributes on thehtmlroot element which are used to enforce CSS specificity (notably:id).So for me this is not a deal breaker as I can just set all required attributes statically in
index.html, but this could be problematic for other devs.