23481 Posts in 18965 Topics by 2878 members
|Go to End|
17 August 2011 at 9:04pm
I have tried adding some anchor tags using the editor and cant work out how to do it.. whenever I put them in, it creates a link with a space in there, eg:
<a name="name-of-link"> </a>
Is there a reason for this or a way to stop it?
17 August 2011 at 10:20pm
I think this a TinyMCE issue rather then a SilverStripe one. TinyMCE is set to not accept emty tags like that, so it'll add a non-breakable space to it. If you really want it removed you should probably look on the TinyMCE forums...
But on some browsers an empty anchor tag wouldn't even work. Would it be a good idea to move the anchor to a spot where the space doesn't hurt, like at the end of an article title?
24 November 2011 at 2:31pm Last edited: 24 November 2011 2:32pm
I have a similar problem where the anchor tags are showing an underlined space.
html produced by tinymce/ss insert link:
<h2><a name="myanchor"> </a>My heading here</h2>
_My heading here
25 November 2011 at 12:42am Last edited: 25 November 2011 12:42am
An anchor tag is just another <a>...</a> tag and by default these appear underlined, even for spaces... So apart from getting rid of the added $nbsp; all together, you'll probably have to handle this in css.
Btw: you can disable the automatic addition of the nonbreakable space from an empty anchor. In cms/config.php:
valid_elements' => "@[id|class|style|title],#a[id|rel|...
valid_elements' => "@[id|class|style|title],a[id|rel|...
|Go to Top|