Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrongly formatted literal line #52

Closed
leider opened this issue Jan 4, 2020 · 15 comments · Fixed by #57
Closed

Wrongly formatted literal line #52

leider opened this issue Jan 4, 2020 · 15 comments · Fixed by #57
Assignees
Labels
type: bug Functionality that does not work as intended/expected

Comments

@leider
Copy link

leider commented Jan 4, 2020

            | !{variableWithHtmlString}

is formatted to

!{variableWithHtmlString}

Breaks rendering

@leider
Copy link
Author

leider commented Jan 4, 2020

Two issues here:

  1. indentation change
  2. removal of "|"

@Shinigami92 Shinigami92 self-assigned this Jan 4, 2020
@Shinigami92 Shinigami92 added the type: bug Functionality that does not work as intended/expected label Jan 4, 2020
@Shinigami92
Copy link
Member

I couldn't reproduce the issue :(
Could you check my test files?

https://github.com/prettier/plugin-pug/pull/57/files

Maybe I need more content to test

@leider
Copy link
Author

leider commented Jan 4, 2020

this is minimal example:

div
  a(href="")
    h6 A
  | !{veranstaltung.renderedPresseText()}

@Shinigami92
Copy link
Member

div
  a(href="")
    h6 A
  | !{veranstaltung.renderedPresseText()}

Ja! Nun kann ich es reproduzieren 😉

@leider
Copy link
Author

leider commented Jan 4, 2020

Das freut!

@leider
Copy link
Author

leider commented Jan 4, 2020

That has been the show stopper for today's pleasure!

@Shinigami92
Copy link
Member

Thats why I want to reflect the other things only as a workaround

  • it's better code with the workaround
  • it's not that urgent like this issue
  • I can release the next version in the next few minutes :)

@leider
Copy link
Author

leider commented Jan 4, 2020 via email

@Shinigami92
Copy link
Member

Could you give me a GO for these "documentations"?
https://github.com/prettier/plugin-pug#some-workarounds

@leider
Copy link
Author

leider commented Jan 4, 2020

For #53 only the workaround with template string works for me. Better remove the other proposal: input(onClick="methodname('" + variable + "', this)")

You can check it out, it will also transform to a non working variant.

@leider
Copy link
Author

leider commented Jan 4, 2020

#54 is OK

@Shinigami92
Copy link
Member

For #53 only the workaround with template string works for me. Better remove the other proposal: input(onClick="methodname('" + variable + "', this)")

You can check it out, it will also transform to a non working variant.

Is it because you are forced to double quotes in this place?
Can you test if input(onClick='methodname("' + variable + '", this)') is working for you?

@Shinigami92
Copy link
Member

Nevermind... I see 😒 OK this is a problem, but I would want to work on it later

@leider
Copy link
Author

leider commented Jan 4, 2020

transforms to input(onClick="methodname(\"' + variable + '\", this)")
not ok

@Shinigami92
Copy link
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Functionality that does not work as intended/expected
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants