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

Editor: Consistent styles between editor and rendered html #500

Open
xiaoniuniu89 opened this issue Oct 8, 2023 · 3 comments
Open

Editor: Consistent styles between editor and rendered html #500

xiaoniuniu89 opened this issue Oct 8, 2023 · 3 comments

Comments

@xiaoniuniu89
Copy link
Contributor

Context

This is a story of master feature #197
The editor is in components/editor

Expected Behavior

Styles between the editor and the rendered content should match and be consistent.

Current Behavior

Elements, such as code, codeblock , link etc look different.

Steps to reproduce

  1. go to /alpha/create/new
  2. add some text and add some formatting to the text such as code, link and any others in the toolbar.
  3. Click preview button
  4. styles will not match 100%

Additional info

https://tiptap.dev/guide/styling

@DarrachBarneveld
Copy link
Contributor

Would a readonly editor mode a solution or will it affect posted articles/old articles?

@xiaoniuniu89
Copy link
Contributor Author

This could be a potential solution, if you check the documentation of tip tap to see what are the trade offs for this approach. In particular if there are any accessibility issues with displaying posts as a read only editor instance

Thanks

@DarrachBarneveld
Copy link
Contributor

It doesn't mention anything specifically but could be resource intensive. I used this approach to add styling to code blocks in #507. I can fix the conflicts now and I would appreciate your insight.

#525 uses the renderhtml method on individual nodes. So basically the generate html method as used before.

Thanks

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

No branches or pull requests

2 participants