I'm running D7 and Panopoly and the HTML editor is stripping out css classes that begin with hyphen (ex: class="cta -btn" produces class="cta").
Repeatable: Always
Steps to repeat:
1. Edit a node with a body field using the HTML editor
2. Add HTML with a class with a hyphen class name
3. Save changes
4. View source HTML of outputted page
Expected Results:
<a href="#" class="cta -btn">
<span class="wrap">
<span class="content">See Where This Takes You</span>
</span>
</a>
Actual Results:
<a href="#" class="cta">
<span class="wrap">
<span class="content">See Where This Takes You</span>
</span>
</a>
I’ve found that allowed class names are filtered in the Rules for Class Names section of /admin/config/content/formats/panopoly_html_text but when I add -*, it says it’s an invalid expression. However, W3C says a single hyphen is allowed at the beginning of a class.
Comments
Comment #1
dsnopekThat filtering is provided by the wysiwyg_filter module:
https://www.drupal.org/project/wysiwyg_filter
I'm moving this issue over there.
Comment #2
geek-merlinIf this still applies (which i doubt), the issue must lie in the class name regexp which is configurable.
Comment #3
geek-merlinComment #4
cboyden CreditAttribution: cboyden commentedAccording to the help text for WYSIWYG Filter's allowed class names field:
If you enter a class name that starts with a hyphen, you get an error message like this:
This error isn't coming from Panopoly, it's in the validation provided by wysiwyg_filter.
Comment #6
geek-merlin