tinymce-line-height-plugin
tinymce-line-height-plugin copied to clipboard
Line height is applied to span element which doesnt work with lower values
When we select the content, the parent element (
) is selected and a span element is added within this. However, if a value is selected which is smaller than the default line height value of the
element, it doesn't work. Basically the line-height never goes less than the parent's line height value.
Its probably a css property (inline property cannot have a lower line height than its parent?) but that makes it difficult to provide a dropdown for selecting line heights that are smaller than the current. Unless it can be applied to the parent itself and not a a span.
Please let me know if there's a way around this...thanks!
+1
+1
Any update on this?
Since the editor main tag is a paragraph, it always have a large spaces between another line. If you just simply manage to remove its margin and padding, then the span element with its line-height will just work look right. However a value lower than 18pt still wont work.
To achieve this
'content_css' : './path_to/your/content.css',
/* TinyMCE content.css */
p {
margin: 0;
padding: 0;
border: 0;
}
You can just change the default value of the line-height with options that is equal and higher than 10pt.
tinymce.init({
...
lineheight_formats: "10pt 18pt 20pt 22pt 24pt 26pt 36pt",
...
});
It is just a temporary work around.