Hi there,
when applying a text style (e.g. a text color) to some marked markup, CK Editor generates a <span> tag around that markup and adds a corresponding style attribute. Now, when that markup contains anchor tags, the style of the span tag does not modify the visualization of what's in those anchor tags. I noticed that when highlighting a section of text that crosses paragraphs, CK Editor cleanly puts span tags within those tags thereby preserving correct HTML. The same would be useful for anchor tags.
Is there a way to turn that behavior on? Is there a reason why that wouldn't make sense?
Thanks
Henning
when applying a text style (e.g. a text color) to some marked markup, CK Editor generates a <span> tag around that markup and adds a corresponding style attribute. Now, when that markup contains anchor tags, the style of the span tag does not modify the visualization of what's in those anchor tags. I noticed that when highlighting a section of text that crosses paragraphs, CK Editor cleanly puts span tags within those tags thereby preserving correct HTML. The same would be useful for anchor tags.
Is there a way to turn that behavior on? Is there a reason why that wouldn't make sense?
Thanks
Henning
Re: How to apply text style in a more useful way
config.js
Might point you in a useful direction
Re: How to apply text style in a more useful way
So it would be neat, if span could simply be added to the list of valid child elements of an anchor - which would perfectly solve my problem. I will give it a try.
I would be interested if there is a reason to exclude span or if that is just an oversight?
Is this actually the right place to post suggestions for code changes?
Thanks!
Henning
Re: How to apply text style in a more useful way
In core/dtd.js, in the function body returning CKEDITOR.dtd, there is an object property for every tag:
The capital letter object L,K,M,... are groups of tags. I changed the snippet above to:
(Note the change of property "a".)
I am sure it would be smarter to update the groups of tags correspondingly but I was not certain of the side effects. Anyway: This works in terms of applying styles even across anchor tags and so far I was not able to detect any negative side effect. Hence it would be nice to have this (or something equivalent) in the next CKEditor version.
Thanks,
Henning