Comparing version 5.4.1 to 5.4.2
@@ -347,5 +347,8 @@ import * as imageHelper from '../helper/image.js'; | ||
} | ||
function isLatin(ch) { | ||
function isAlphabeticLetter(ch) { | ||
var code = ch.charCodeAt(0); | ||
return code >= 0x21 && code <= 0x17F; | ||
return code >= 0x20 && code <= 0x24F | ||
|| code >= 0x370 && code <= 0x10FF | ||
|| code >= 0x1200 && code <= 0x13FF | ||
|| code >= 0x1E00 && code <= 0x206F; | ||
} | ||
@@ -357,3 +360,3 @@ var breakCharMap = reduce(',&?/;] '.split(''), function (obj, ch) { | ||
function isWordBreakChar(ch) { | ||
if (isLatin(ch)) { | ||
if (isAlphabeticLetter(ch)) { | ||
if (breakCharMap[ch]) { | ||
@@ -360,0 +363,0 @@ return true; |
@@ -44,5 +44,5 @@ import { keys, map } from '../core/util.js'; | ||
function convertElToString(el) { | ||
var children = el.children, tag = el.tag, attrs = el.attrs; | ||
var children = el.children, tag = el.tag, attrs = el.attrs, text = el.text; | ||
return createElementOpen(tag, attrs) | ||
+ encodeHTML(el.text) | ||
+ (tag !== 'style' ? encodeHTML(text) : text || '') | ||
+ (children ? "" + S + map(children, function (child) { return convertElToString(child); }).join(S) + S : '') | ||
@@ -49,0 +49,0 @@ + createElementClose(tag); |
{ | ||
"name": "zrender", | ||
"version": "5.4.1", | ||
"version": "5.4.2", | ||
"description": "A lightweight graphic library providing 2d draw for Apache ECharts", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -594,5 +594,13 @@ import * as imageHelper from '../helper/image'; | ||
function isLatin(ch: string) { | ||
function isAlphabeticLetter(ch: string) { | ||
// Unicode Character Ranges | ||
// https://jrgraphix.net/research/unicode_blocks.php | ||
// The following ranges may not cover all letter ranges but only the more | ||
// popular ones. Developers could make pull requests when they find those | ||
// not covered. | ||
let code = ch.charCodeAt(0); | ||
return code >= 0x21 && code <= 0x17F; | ||
return code >= 0x20 && code <= 0x24F // Latin | ||
|| code >= 0x370 && code <= 0x10FF // Greek, Coptic, Cyrilic, and etc. | ||
|| code >= 0x1200 && code <= 0x13FF // Ethiopic and Cherokee | ||
|| code >= 0x1E00 && code <= 0x206F; // Latin and Greek extended | ||
} | ||
@@ -608,3 +616,3 @@ | ||
function isWordBreakChar(ch: string) { | ||
if (isLatin(ch)) { | ||
if (isAlphabeticLetter(ch)) { | ||
if (breakCharMap[ch]) { | ||
@@ -611,0 +619,0 @@ return true; |
@@ -73,5 +73,5 @@ import { keys, map } from '../core/util'; | ||
function convertElToString(el: SVGVNode): string { | ||
const {children, tag, attrs} = el; | ||
const {children, tag, attrs, text} = el; | ||
return createElementOpen(tag, attrs) | ||
+ encodeHTML(el.text) | ||
+ (tag !== 'style' ? encodeHTML(text) : text || '') | ||
+ (children ? `${S}${map(children, child => convertElToString(child)).join(S)}${S}` : '') | ||
@@ -78,0 +78,0 @@ + createElementClose(tag); |
@@ -488,5 +488,5 @@ /*! | ||
*/ | ||
export const version = '5.4.1'; | ||
export const version = '5.4.2'; | ||
export interface ZRenderType extends ZRender {}; |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4045450
370
64859