问题
Is there a quick way to remove html markup from a string ? The problem is I am copying the description from stories to the clipboard, we just want plain text but of course the value of description will be marked up. So I want to turn ...
<SPAN style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: #1f497d; FONT-SIZE: 11pt; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA">text text text</SPAN>
into
text text text
回答1:
If you are using ExtJS (or Rally App SDK 2.x):
Ext.util.Format.stripTags(...);
http://docs.sencha.com/ext-js/4-0/#!/api/Ext.util.Format-method-stripTags https://rally1.rallydev.com/apps/2.0p/doc/#!/api/Ext.util.Format-method-stripTags
来源:https://stackoverflow.com/questions/10442084/remove-html-markup-from-rally-description-field