vendor/assets/javascripts/parser_rules/advanced.js in wysihtml5x-rails-0.4.10 vs vendor/assets/javascripts/parser_rules/advanced.js in wysihtml5x-rails-0.4.11
- old
+ new
@@ -79,17 +79,24 @@
* The following options are available:
*
* - add_class: converts and deletes the given HTML4 attribute (align, clear, ...) via the given method to a css class
* The following methods are implemented in wysihtml5.dom.parse:
* - align_text: converts align attribute values (right/left/center/justify) to their corresponding css class "wysiwyg-text-align-*")
- * <p align="center">foo</p> ... becomes ... <p> class="wysiwyg-text-align-center">foo</p>
+ * <p align="center">foo</p> ... becomes ... <p class="wysiwyg-text-align-center">foo</p>
* - clear_br: converts clear attribute values left/right/all/both to their corresponding css class "wysiwyg-clear-*"
* <br clear="all"> ... becomes ... <br class="wysiwyg-clear-both">
* - align_img: converts align attribute values (right/left) on <img> to their corresponding css class "wysiwyg-float-*"
- *
+ *
+ * - add_style: converts and deletes the given HTML4 attribute (align) via the given method to a css style
+ * The following methods are implemented in wysihtml5.dom.parse:
+ * - align_text: converts align attribute values (right/left/center) to their corresponding css style)
+ * <p align="center">foo</p> ... becomes ... <p style="text-align:center">foo</p>
+ *
* - remove: removes the element and its content
*
+ * - unwrap removes element but leaves content
+ *
* - rename_tag: renames the element to the given tag
*
* - set_class: adds the given class to the element (note: make sure that the class is in the "classes" white list above)
*
* - set_attributes: sets/overrides the given attributes
@@ -98,10 +105,11 @@
* - url: allows only valid urls (starting with http:// or https://)
* - src: allows something like "/foobar.jpg", "http://google.com", ...
* - href: allows something like "mailto:bert@foo.com", "http://google.com", "/foobar.jpg"
* - alt: strips unwanted characters. if the attribute is not set, then it gets set (to ensure valid and compatible HTML)
* - numbers: ensures that the attribute only contains numeric characters
+ * - any: allows anything to pass
*/
"tags": {
"tr": {
"add_class": {
"align": "align_text"
@@ -178,15 +186,15 @@
"figcaption": {
"rename_tag": "div"
},
"a": {
"check_attributes": {
+ "target": "any",
"href": "url" // if you compiled master manually then change this from 'url' to 'href'
},
"set_attributes": {
- "rel": "nofollow",
- "target": "_blank"
+ "rel": "nofollow"
}
},
"img": {
"check_attributes": {
"width": "numbers",
@@ -548,6 +556,6 @@
},
"header": {
"rename_tag": "div"
}
}
-};
\ No newline at end of file
+};