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

Render custom (long-text) columns with whitespace: pre-wrap #69

Merged
merged 2 commits into from
Nov 13, 2023

Conversation

Mikescher
Copy link

Currently if we show the content of a custom column of type comments (in the book preview) we loose all line-breaks and leading whitespaces.

image

This commit PR parses the display column from the database and adds white-space: pre-wrap, to properly render the content (if interpret_as is either html, long-text or markdown).
For the fourth possible interpret-as value short-text, we keep the current display: inline behavior.

image

In the future it could be nice to really render the content if interpret_as is html or markdown. (Markdown would be pretty easy, but html would need a proper html sanitizer to prevent XSS)...

@mikespub
Copy link
Member

Nice - I haven't really played with display options in Calibre for custom columns, but if it works for you that's fine

@mikespub mikespub merged commit 4980d3e into mikespub-org:main Nov 13, 2023
@mikespub mikespub added the enhancement New feature or request label Nov 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants