tinymce-line-height-plugin icon indicating copy to clipboard operation
tinymce-line-height-plugin copied to clipboard

Line height is applied to span element which doesnt work with lower values

Open kujain opened this issue 8 years ago • 4 comments

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!

kujain avatar Apr 08 '16 18:04 kujain

+1

vnmone avatar Apr 17 '17 14:04 vnmone

+1

Martin-Eckleben avatar May 19 '17 08:05 Martin-Eckleben

Any update on this?

jonastandinco avatar Nov 29 '17 03:11 jonastandinco

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.

roelzkie15 avatar May 10 '18 01:05 roelzkie15