Feature request: add more built-in rich text formats
See original GitHub issueThis is a feature request question. When browse the draftail examples page, I could see many formats not included in wagtail 2.1 version (under “All built-in formats” section).
Code: Code
Underline: Underline
Strikethrough: Strikethrough
Mark: Mark
Quotation: Quotation
Small: Small
Sample: Sample
Insert: Insert
Delete: Delete
Keyboard: Keyboard
Superscript: Superscript
Subscript: Subscript
Blockquote
Is there a plan to integrate latest version for draftail into wagtail?
Issue Analytics
- State:
- Created 5 years ago
- Comments:16 (13 by maintainers)
Top Results From Across the Web
Extend rich text editor component - Feature Requests
It would be great to have the ability to extend the rich text editor to include additional formatting options.
Read more >More Rich Text Formatting Options? - Prismic People
The team is aware of the requests for more built-in rich text formatting options and plan to integrate them once we overhaul the...
Read more >Adding Rich Text - Yext Hitchhikers
Add the rich text formatter to the field that uses rich text. Either disable truncation or update the card to handle RTF truncation,...
Read more >add Rich Text / HTML content & images to a guide - Help Center
Learn more about the different features of the rich text editor below. Styles; Paragraph formats; Fonts; Text colors; Bold, italic, and strikethrough formatting...
Read more >Feature request: Rich text formatting and inline images in the ...
We are transitioning to the web form, away from email for ticket creation purposes. Both internal and external stakeholders miss the ability ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
👍 for adding all the above to Wagtail but disabled by default. (We don’t want to encourage use of underline because that style should be reserved for links, and superscript/subscript are probably also ‘niche’ enough that it makes sense for them to be opt-in.)
Actually, looking at the code again I forgot that the “built-in Draftail formats” go beyond styles. They also come with pre-defined labels and descriptions in english, and some also have keyboard shortcuts.
Here are the ones that come with keyboard shortcuts:
https://github.com/springload/draftail/blob/1a582d2c1e9a803e31b99453500e3b5c6c9f0bf0/lib/api/constants.js#L237-L271
This is not customisable in any way, you have to use the exact identifier (e.g.
SUBSCRIPT
string, uppercase, orcode-block
string, lowercase) to get this, so I think it’s a good argument to have those built-in – so people using these benefit from the keyboard shortcut, and there is less risk of defining a feature that does what these do without using the ““right”” identifier.– and if anyone wonders why these get special treatment, it’s because they are available in traditional word processors (Word, Google Docs) or in Markdown and use those shortcuts there.
Here is the full list of what I think should be supported, with the
feature name
first then the Draft.js type, then the HTML tag.Inline styles
code
,CODE
,<code>
superscript
,SUPERSCRIPT
,<sup>
subscript
,SUBSCRIPT
,<sub>
strikethrough
,STRIKETHROUGH
,<s>
underline
,UNDERLINE
,<u>
Blocks
blockquote
,blockquote
,<blockquote>
code-block
,code-block
,<pre>
or<pre><code>