Fix html2ft edge cases, group custom attrs, add tests #581
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
name: Pull Request
about: Propose changes to the codebase
title: '[PR] '
labels: ''
assignees: ''
Related Issue
Current issues with html2f implementation
<div x-transition:enter.scale.80 x-transition:leave.scale.90>hello</div>
incorrectly converts toDiv('hello', **{'x-transition:enter.scale.80':''}, **{'x-transition:leave.scale.90':''})
<div id="1">hello</div>
incorrectly converts toDiv('hello', id='1')
withattrs1st=True
(Not a bug but inconvenience):
Div('Hello 👋', x_show='open', **{'x-transition:enter':'transition duration-300'}, **{'x-transition:enter-start':'opacity-0 scale-90'})
<- custom attributes spread around multiple dictionaries as opposed to being grouped into 1 dictionary, e.g.Div('Hello 👋', x_show='open', **{'x-transition:enter':'transition duration-300', 'x-transition:enter-start':'opacity-0 scale-90'})
Proposed Changes
This PR addresses the issues mentioned above ⬆️ and adds tests for htm2ft function
Types of changes
What types of changes does your code introduce? Put an
x
in all the boxes that apply: