Skip to content

Commit 1c3b798

Browse files
author
Oliver Pulges
committed
Update to 0.4.11
1 parent 5fde45e commit 1c3b798

File tree

4 files changed

+22
-12
lines changed

4 files changed

+22
-12
lines changed

lib/wysihtml5x/rails/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module Wysihtml5x
22
module Rails
3-
VERSION = "0.4.10"
3+
VERSION = "0.4.11"
44
end
55
end

vendor/assets/javascripts/parser_rules/advanced.js

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,13 +81,20 @@ var wysihtml5ParserRules = {
8181
* - add_class: converts and deletes the given HTML4 attribute (align, clear, ...) via the given method to a css class
8282
* The following methods are implemented in wysihtml5.dom.parse:
8383
* - align_text: converts align attribute values (right/left/center/justify) to their corresponding css class "wysiwyg-text-align-*")
84-
* <p align="center">foo</p> ... becomes ... <p> class="wysiwyg-text-align-center">foo</p>
84+
* <p align="center">foo</p> ... becomes ... <p class="wysiwyg-text-align-center">foo</p>
8585
* - clear_br: converts clear attribute values left/right/all/both to their corresponding css class "wysiwyg-clear-*"
8686
* <br clear="all"> ... becomes ... <br class="wysiwyg-clear-both">
8787
* - align_img: converts align attribute values (right/left) on <img> to their corresponding css class "wysiwyg-float-*"
88-
*
88+
*
89+
* - add_style: converts and deletes the given HTML4 attribute (align) via the given method to a css style
90+
* The following methods are implemented in wysihtml5.dom.parse:
91+
* - align_text: converts align attribute values (right/left/center) to their corresponding css style)
92+
* <p align="center">foo</p> ... becomes ... <p style="text-align:center">foo</p>
93+
*
8994
* - remove: removes the element and its content
9095
*
96+
* - unwrap removes element but leaves content
97+
*
9198
* - rename_tag: renames the element to the given tag
9299
*
93100
* - set_class: adds the given class to the element (note: make sure that the class is in the "classes" white list above)
@@ -100,6 +107,7 @@ var wysihtml5ParserRules = {
100107
* - href: allows something like "mailto:[email protected]", "http://google.com", "/foobar.jpg"
101108
* - alt: strips unwanted characters. if the attribute is not set, then it gets set (to ensure valid and compatible HTML)
102109
* - numbers: ensures that the attribute only contains numeric characters
110+
* - any: allows anything to pass
103111
*/
104112
"tags": {
105113
"tr": {
@@ -180,11 +188,11 @@ var wysihtml5ParserRules = {
180188
},
181189
"a": {
182190
"check_attributes": {
191+
"target": "any",
183192
"href": "url" // if you compiled master manually then change this from 'url' to 'href'
184193
},
185194
"set_attributes": {
186-
"rel": "nofollow",
187-
"target": "_blank"
195+
"rel": "nofollow"
188196
}
189197
},
190198
"img": {
@@ -550,4 +558,4 @@ var wysihtml5ParserRules = {
550558
"rename_tag": "div"
551559
}
552560
}
553-
};
561+
};

vendor/assets/javascripts/wysihtml5x-toolbar.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ if(!Array.isArray) {
2525
return Object.prototype.toString.call(arg) === '[object Array]';
2626
};
2727
};/**
28-
* @license wysihtml5x v0.4.10
28+
* @license wysihtml5x v0.4.11
2929
* https://github.com/Edicy/wysihtml5
3030
*
3131
* Author: Christopher Blum (https://github.com/tiff)
@@ -36,7 +36,7 @@ if(!Array.isArray) {
3636
*
3737
*/
3838
var wysihtml5 = {
39-
version: "0.4.10",
39+
version: "0.4.11",
4040

4141
// namespaces
4242
commands: {},
@@ -11845,7 +11845,8 @@ wysihtml5.views.View = Base.extend(
1184511845

1184611846
isEmpty: function() {
1184711847
var innerHTML = this.element.innerHTML.toLowerCase();
11848-
return innerHTML === "" ||
11848+
return (/^\s*$/i).test(innerHTML) ||
11849+
innerHTML === "" ||
1184911850
innerHTML === "<br>" ||
1185011851
innerHTML === "<p></p>" ||
1185111852
innerHTML === "<p><br></p>" ||

vendor/assets/javascripts/wysihtml5x.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ if(!Array.isArray) {
2525
return Object.prototype.toString.call(arg) === '[object Array]';
2626
};
2727
};/**
28-
* @license wysihtml5x v0.4.10
28+
* @license wysihtml5x v0.4.11
2929
* https://github.com/Edicy/wysihtml5
3030
*
3131
* Author: Christopher Blum (https://github.com/tiff)
@@ -36,7 +36,7 @@ if(!Array.isArray) {
3636
*
3737
*/
3838
var wysihtml5 = {
39-
version: "0.4.10",
39+
version: "0.4.11",
4040

4141
// namespaces
4242
commands: {},
@@ -11845,7 +11845,8 @@ wysihtml5.views.View = Base.extend(
1184511845

1184611846
isEmpty: function() {
1184711847
var innerHTML = this.element.innerHTML.toLowerCase();
11848-
return innerHTML === "" ||
11848+
return (/^\s*$/i).test(innerHTML) ||
11849+
innerHTML === "" ||
1184911850
innerHTML === "<br>" ||
1185011851
innerHTML === "<p></p>" ||
1185111852
innerHTML === "<p><br></p>" ||

0 commit comments

Comments
 (0)