dy / xhtm

XHTM − eXtended Hyperscript Tagged Markup
MIT License
25 stars 2 forks source link

Redundant logical OR in regexp #24

Closed aral closed 1 year ago

aral commented 1 year ago

Unless I’m missing something, the OR at https://github.com/dy/xhtm/blob/master/htm.js#L91 is redundant (both sides are the same).

dy commented 1 year ago

Ah, right, that's artifact from /(?<=^|>|\ue000)\s*\n\s*|\s*\n\s*(?=$|<|\ue000)/g. Good to go for me!

aral commented 1 year ago

Hey Dmitry, I thought it was something like that :) (I also verified the regular expression equivalence via https://bakkot.github.io/dfa-lib/regeq.html just in case.)

Hope you’re having a lovely weekend :)