WIP: Fix handling of right angle bracket (`>`) in attributes
This is the fix suggested by @jon-sully in https://github.com/threedaymonk/htmlbeautifier/issues/78#issuecomment-2369219951
It may need further work and verification, so I'm only opening it as a draft for now to allow for discussion.
Also, it breaks one of the current tests: HtmlBeautifier indents general self-closing tags
i couldnt really come up with a more clever regex but testing in regex101 the following still matched,
%r{ (?:<%.*?%>|(?:[^"]*?->[^"]*?)|[^>])* }mx
its a bit dumber but just allows > within quotes
Hmm actually it lead me to adjust it once more to the following
%r{ (?:[^"]?[-%]>[^"]?|[^>])* }mx
moved the erb tag or - check together [-%]
im not sure if this is correct but, ill fork sometime next week and see for myself
So i gave it a try, neither of my queries were perfect %r{ (?:[^"]?[-%]>[^"]?|[^>])* }mx is close.. but it breaks
it "stays indented within <details> with Boolean attribute handled by ERB" do
@andyw8 i did notice if your revert
all tests will pass, was this change intentional?
It was copied from https://github.com/threedaymonk/htmlbeautifier/issues/78#issuecomment-2369219951 but I haven't yet looked into it.