Opened 15 years ago
Closed 15 years ago
#5292 closed Bug (fixed)
Preview in font-size and font-family doesn't work with custom styles
Reported by: | Alfonso Martínez de Lizarrondo | Owned by: | Alfonso Martínez de Lizarrondo |
---|---|---|---|
Priority: | Normal | Milestone: | CKEditor 3.3 |
Component: | General | Version: | 3.2 |
Keywords: | Review+ | Cc: |
Description
Using the XHTML sample in #5024, the previews of font-size and font-family doesn't reflect the current values.
Attachments (2)
Change History (8)
Changed 15 years ago by
Attachment: | 5292.patch added |
---|
comment:1 Changed 15 years ago by
Keywords: | Review- added; Review? removed |
---|
The problem is we've already had such implementation. It would be better to introduce a 'buildlPreviewHtml' method on CKEDITOR.style that encapsulate those logics to be used by all places, including fonts, format and styles.
comment:2 Changed 15 years ago by
I thought about it but there's a problem with CKEDITOR.style::getStyleText because it will try to normalize the css style and it chokes when it finds a value like font-family:#(family)
The option that I see would be to put pass to that CKEDITOR.style.buildPreviewHtml the styleDefinition as well as the cssStyle to use, and in the font plugin specify a placeholder like #(name) for the styleDefinition name and replace it in the loop.
Now that I think about it my original patch used a regExp for the value, but a simple string replacement would have been enough.
So: Do I create such CKEDITOR.style.buildPreviewHtml( styleDefinition, cssStyle ) function?
comment:3 Changed 15 years ago by
it chokes when it finds a value like font-family:#(family).
True, the original implementation doesn't consider variables in style (it operate on style definition), while if an method is introduced, it operates naturally on compiled style object so such problem will vanish.
comment:4 Changed 15 years ago by
Keywords: | Review? added; Review- removed |
---|
This was much easier that I thought.
comment:5 Changed 15 years ago by
Keywords: | Review+ added; Review? removed |
---|
Proposed patch