Topic: how to change underline function to <u> ?
hi,
how can i change the underline function from <span style="text-decoration: underline"> to <u> ?
best regards
marcel
Pages 1
hi,
how can i change the underline function from <span style="text-decoration: underline"> to <u> ?
best regards
marcel
no solution ??? ![]()
Any luck with this issue? I'm having the same problem. Thanks!
U is deprecated so. Follow the W3C specs.
ok but when i allow the <span> tag than the user can insert via copy paste many waste that shouldn't be allowed
and i couldn't use strip_tags
Disable inline_styles option.
what does the option "inline_styles" do ?
Inline styles converts most attributes into CSS style attributes - so it will use span tags rather than <u>, <strike>, stc. So, disabling this option (which is now enabled by default) gives the behaviour you're looking for.
hi zooey thx for the explanation i will test this
This will do it:
tinyMCE.init({
...
formats : {
underline : {inline : 'u', exact : true}
}
...
Use the legacyoutput plugin if you want old and deprecated HTML.
The Legacy Output plugin forces align attributes and font tags. I definitely do not want these. Just the <u>.
Why? Either you should use modern tags or not. The only reason why someone should use the legacyoutput plugin is if there is compatibility issues with the HTML with rendering on Flash or in old mail clients.
Why? Either you should use modern tags or not. The only reason why someone should use the legacyoutput plugin is if there is compatibility issues with the HTML with rendering on Flash or in old mail clients.
Actually, that's not at all true.
I would like to force my clients to use U and S tags rather than inline styles because I don't want them to have arbitrary control over the formatting of the page. I want them to be able to underline and strike-through text, but not set the font color or the font face, for example. So, I have a post-processing filter that I use to strip out SPAN tags and many others.
Deprecated HTML tags are rarely ever remove from browsers. There should be a nice easy switch to turn on "old" semantic tags rather than inline styles. I agree that being "standards compliant" is important, but so it being flexible.
Last edited by TimmerCA (2011-07-16 00:23:09)
I would like to force my clients to use U and S tags rather than inline styles because I don't want them to have arbitrary control over the formatting of the page.
Using deprecated elements is NOT the best way to go. Why not use special class names and do the rest using CSS?
So, I have a post-processing filter that I use to strip out SPAN tags and many others.
Why kill the messenger when you have a problem with the message? Removing <span> elements just because of an unwanted attribute is a little harsh, don't you think? Why not remove style attributes instead?
Deprecated HTML tags are rarely ever remove from browsers.
This is a very weak argument. Browsers parse tag soup. That is one thing. Having standards-compliant code is another.
There should be a nice easy switch to turn on "old" semantic tags rather than inline styles.
The deprecated tags are deprecated because they have nothing to do with semantics! So there is no "old semantic tag"! The tags in question (<s> and <u>) have the sole purpose of changing the visual representation. Other than that they carry no meaning, hence no semantics!
I agree that being "standards compliant" is important, but so it being flexible.
So, be flexible then! Think of more sophisticated ways to achieve your visual goal while still producing standards-compliant code!
i am very sorry, for bumping this thread. But: while trying to keep the standards and not use the unwanted U tag i had difficult time.
I am using these valid elements a[href|target],br,em/i,span[style],strong/b,li,ol,p,ul,u (i have tried other combinations also) and when i set valid_styles for (example this {"*":"text-decoration"})
the underline refuses to work. Only solution is to remove the valid styles tag, which is not what I want, and what you suggest to do. Maybe is this a bug?
Can someone provide a working example of using underline as valid element, while using the valid_styles parameter?
So you want stuff to look underlined? That may not be a good idea since people associate underlined content with clickable hyperlinks.
A solution to purely visual issues should use CSS. You either define a certain class (let's call it "marked") as in these two examples:
<p>This is <span class="marked">marked content</span> for better readability.</p>
<p class="marked">Sometimes everything is so important that people simply must highlight it.</p>Your CSS could then make use of this class name:
.marked { text-decoration: underline; }But this is all basic HTML/CSS knowledge. Why wouldn't you want a solution like this?
I am not asking how to do something but, why something is not working. This solution does not work for me as i dont want classes(Classes MUST be filtered).
A repeat: valid_elements: span[style]
This means that i can have a span element with the style attribute
valid_styles: {"*" : "text-decoration"}
This means that accepted style is only text-decoration for all elements (*)
So why this is not working as it should?
Thanks a lot for the quick answer but I hope the next will be more relevant to what I ask.
I am not asking how to do something but, why something is not working.
Maybe this is the first obstacle to finding a solution?
valid_styles: {"*" : "text-decoration"}
I'm not familiar with this configuration option. The wiki doesn't list it. I also couldn't find any plugin to provide such an option.
So what made you think your approach could work?
http://www.tinymce.com/forum/viewtopic.php?pid=76101#p76101
From as far as you can see from this post, this option exists a lot time, but it has stayed undocumented for an unknown reason.
My approach would have worked, if valid_styles worked the way expected. And this is the main goal of valid_styles. To filter styles!!!
My approach would have worked, if valid_styles worked the way expected. And this is the main goal of valid_styles. To filter styles!!!
Maybe this is the reason why it still hasn't been documented...?
I strongly suggest you rethink your approach. But you don't have to heed my advice of course.
My friend I can also think other approaches. But for many reasons, I find it as the most "suitable" in my case.
It seems however that it was not good to relay on this option, although it would be great when it becomes working.
I solved my problem by using an alternative (span[style<text-decoration: underline;]).
Your solution, is also a nice one, but it needs to change the underline format in order to work as i need, and i don't know if pasting from word (or generally pasting)would auto transform it to this format (<span class="underline-class">).
So because there is no time for test, i used my first option. Thanks a lot for the help, but please try to answer what someone asks (my main question was why is valid_styles not working {here http://www.tinymce.com/forum/viewtopic.
101#p76101 MAIN DEVELOPER suggests to use it and says it has to be documented})
My friend I can also think other approaches.
I don't doubt that. But you need a working solution. I gave you one.
It seems however that it was not good to relay on this option, although it would be great when it becomes working.
True.
but please try to answer what someone asks
Often the direct answer isn't really helpful. I try to help. Sometimes helping means to tell people that in my opinion they need to abandon their original plan. And since this is a free forum people are free to ignore my opinion.
{here http://www.tinymce.com/forum/viewtopic. 101#p76101 MAIN DEVELOPER suggests to use it and says it has to be documented})
I've seen this post since I did follow your link in your previous post. If I remember correctly spocke's reply is over a year(!) old. And if I also remember correctly most of the documentation is generated automagically - apparently (for what reason?) just not this option. This makes me wonder...
So I gave you a viable alternative since you obviously need a working solution.
So, all considered, was I not helpful?
Pages 1
You are not logged in. Please login or register.