Skip to content

Content Model fidelity improvement 4: CENTER tag and alignment#1753

Merged
JiuqingSong merged 10 commits into
masterfrom
u/jisong/fidelity4
Apr 27, 2023
Merged

Content Model fidelity improvement 4: CENTER tag and alignment#1753
JiuqingSong merged 10 commits into
masterfrom
u/jisong/fidelity4

Conversation

@JiuqingSong

Copy link
Copy Markdown
Collaborator

I'll make a series changes to improve content model fidelity.

With HTML align attribute and CSS style text-align, there are complex combinations.

Say a sample HTML:

<div align={align} style="text-align: {textAlign}">
 <div>{text}</div>
 <table>{table}</table>
</div>

The combinations are:

text align html align text result table result
NO NO No alignment No alignment
YES NO follow text align No alignment
NO YES Inherat html align apply html align
YES YES follow text align No alignment

For table, we handle alignment using its margin style. For other blocks, we use align style.

For CENTER tag, for now the easiest way is to use ContentModelGeneralBlock to just directly copy the HTML element itself.

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