Skip to content

Attribute keep line breaks#216

Closed
thet wants to merge 3 commits into
masterfrom
attribute-keep-line-breaks
Closed

Attribute keep line breaks#216
thet wants to merge 3 commits into
masterfrom
attribute-keep-line-breaks

Conversation

@thet
Copy link
Copy Markdown
Member

@thet thet commented May 30, 2026

keep line breaks: Do not reformat class attribute values.
This allows for multi-line or otherwise manually strangely formatted
class attributes.

data-pat-* attributes are already kept.

This PR potentially replaces:
#213
#212
#211

But this does not allow for automatic multiline-formatting. So data-pat-* attributes values and class attributes are not split one-by-line. They just keep the formatting they already have.

@coveralls
Copy link
Copy Markdown

coveralls commented May 30, 2026

Coverage Status

Coverage is 96.824%attribute-keep-line-breaks into master. No base build found for master.

This allows for multi-line or otherwise manually strangely formatted
class attributes.
@thet thet force-pushed the attribute-keep-line-breaks branch from b7b5467 to e8ea579 Compare May 30, 2026 15:54
@thet thet requested a review from ale-rt May 30, 2026 15:54
ale-rt pushed a commit that referenced this pull request May 31, 2026
This was caused by a BeautifulSoup configuration default that caused
some attributes to be stored as a list of strings.
The PR forces all attributes to be stored as string.

Refs. #216
ale-rt pushed a commit that referenced this pull request May 31, 2026
This was caused by a BeautifulSoup configuration default that caused
some attributes to be stored as a list of strings.
The PR forces all attributes to be stored as string.

Refs. #216
@ale-rt
Copy link
Copy Markdown
Member

ale-rt commented May 31, 2026

The reason why this fails is because class is declared as a "multi-valued-attribute":

I think the cleaner solution is to pass the proper argument to the parser, see:

@thet thet closed this May 31, 2026
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.

3 participants