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

Bug: Attribute Wrapping breaks Interpolated Tags #149

Closed
detroitenglish opened this issue Oct 29, 2020 · 5 comments · Fixed by #154
Closed

Bug: Attribute Wrapping breaks Interpolated Tags #149

detroitenglish opened this issue Oct 29, 2020 · 5 comments · Fixed by #154
Assignees
Labels
type: bug Functionality that does not work as intended/expected

Comments

@detroitenglish
Copy link

Info

Tool Version
Plugin v1.x.x
Prettier v2.x.x
Node v12.x.x
OS linux

Input

 strong #[a(href=link, target="_blank", rel="noopener")=link]

.prettierrc

{
  "arrowParens": "avoid",
  "bracketSpacing": true,
  "endOfLine": "lf",
  "printWidth": 80,
  "pugAttributeSeparator": "always",
  "pugClosingBracketPosition": "new-line",
  "pugSingleQuote": false,
  "pugSortAttributes": "asc",
  "pugWrapAttributesPattern": "0",
  "pugWrapAttributesThreshold": 1,
  "semi": false,
  "singleQuote": true,
  "trailingComma": "es5"
}

Output or Error

strong #[a(
  href=link,
  rel="noopener",
  target="_blank"
)= link]
  > 103|                 strong #[a(
------------------------------------^
    104|                   href=link,
    105|                   rel="noopener",
    106|                   target="_blank"

The end of the string reached with no closing bracket ) found.

Expected Output

 strong #[a(href=link, target="_blank", rel="noopener")=link]

Additional Context

@Shinigami92
Copy link
Member

I'm sorry to inform you that I will probably not have time until the weekend to keep working on it

@detroitenglish
Copy link
Author

@Shinigami92 No stress! Thank you for all your hard work on this project 🙇‍♂️

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

I've now fixed the bug because it corrupts the working pug code
But in the long run I think we should create an issue in the pug repo to support this wrapping within the pug code interpolation
In my opinion, pug should handle these types of wrapped attributes

@Shinigami92
Copy link
Member

This has now been fixed in release 1.10.1
Thank you for using my plugin and for being part of the pug community 🤗

@detroitenglish
Copy link
Author

@Shinigami92 Thanks!

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