-
Notifications
You must be signed in to change notification settings - Fork 58
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
Toggling Header Styles #11
Labels
enhancement
New feature or request
Projects
Comments
+1 |
Hopefully this helps!: RE.setHeading = function(heading) {
var sel = document.getSelection().getRangeAt(0).startContainer.parentNode;
document.execCommand('formatBlock', false, sel.tagName === `H${heading}` ? '<p>' : `<h${heading}>`);
}; Note to self: document.execCommand is deprecated, but there's literally no alternative... we'll have to see what happens after finals. Other notes for future meThe sister repo also doesn't seem to have a solution unfortunately... https://github.com/wasabeef/richeditor-android/blob/ce152b910a59c66863baa68b007ac67e6b9de671/richeditor/src/main/assets/rich_editor.js#L155-L157 |
Any ideas where else I can add this besides the heading? |
Fixed in ed734f6 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How can we make the headers to toggle like the bold,italics meaning how to remove heading when clicked for second time.
The header/size buttons should also be a toggle; doesn’t allow to toggle back to default size.
The text was updated successfully, but these errors were encountered: