Adding warnings for non-standard escape sequence usage
This commit is contained in:
@@ -9,7 +9,8 @@ export default class Parser {
|
||||
groupCounter: 1,
|
||||
renderCounter: 0,
|
||||
maxCounter: 0,
|
||||
cancelRender: false
|
||||
cancelRender: false,
|
||||
warnings: []
|
||||
};
|
||||
}
|
||||
|
||||
@@ -58,4 +59,8 @@ export default class Parser {
|
||||
cancel() {
|
||||
this.state.cancelRender = true;
|
||||
}
|
||||
|
||||
get warnings() {
|
||||
return this.state.warnings;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,5 +41,9 @@ export default {
|
||||
this.elements = _.unique(this.properties.parts.elements, part => {
|
||||
return [part.type, part.textValue].join(':');
|
||||
});
|
||||
|
||||
if (this.textValue.match(/\\c[^a-zA-Z]/)) {
|
||||
this.state.warnings.push(`The character set "${this.textValue}" contains the \\c escape followed by a character other than A-Z. This can lead to different behavior depending on browser. The representation here is the most common interpretation.`);
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user