Skip to content

Conversation

@annettemmm
Copy link

@annettemmm annettemmm commented Feb 6, 2024

Hello! I found some cases when unescaping html with != is erroneously being formatted as =.

First case is when the script node in question is indented, has fix + test in pr
Input:

.container
    != hello

Expected output:

.container
    != hello

Actual output:

.container
    = hello

Second case is when the evaluation is on the same line as the tag, and this is an issue for all the following cases (currently failing).

  def test_preserve
    assert_format("%p~ foo")
  end

  def test_escape_html
    assert_format("%div&= foo")
  end

  def test_preserve_escape_html
    assert_format("%p&~ foo")
  end

  def test_unescape
    assert_format('%p!= foo')
  end

I wasn't able to get to this yet, should I open an issue?

@kddnewton
Copy link
Member

Yes please, open an issue! Thank you!

@kddnewton kddnewton merged commit 3b32452 into ruby-syntax-tree:main Feb 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants