Open BehindTheMath opened 6 years ago
Sorry, but I don't understand. It wouldn't work at all if I replaced that code with this.
The problem is that we can't rely on .pl-s
, each language is formatted differently on GitHub. I don't remember now where exactly the problem is, but I hope I'm wrong about it and someday we discover a way to stop using regex and .innerHTML
.
I see what you mean.
I think it could be done, but it would require a separate workflow for each language.
Maybe it is not that hard to implement a separate workflow for each language, and it may be our only choice if the innerHTML
replacements continue to generate bugs.
It can be more difficult and hard to implement, but it's right way for JS, I think.
I think it would be more elegant to manipulate the element objects instead of rewriting innerHTML.
For example, this could be substituted with something like this: