mirror of
https://github.com/TiddlyWiki/TiddlyWiki5.git
synced 2026-04-30 11:36:36 +00:00
Text-slicer: Add support for discarding the content of an element
This commit is contained in:
@@ -340,8 +340,12 @@ Slicer.prototype.onCloseTag = function(name) {
|
||||
|
||||
Slicer.prototype.onText = function(text) {
|
||||
var self = this;
|
||||
text = $tw.utils.htmlEncode(text);
|
||||
// Discard the text if we're inside an element with actions.discard set true
|
||||
if(this.elementStack.some(function(e) {return e.actions.discard;})) {
|
||||
return;
|
||||
}
|
||||
// Optionally escape common character sequences that might be parsed as wikitext
|
||||
text = $tw.utils.htmlEncode(text);
|
||||
if(this.escapeWikiText) {
|
||||
$tw.utils.each(["[[","{{","__","''","//",",,","^^","~~","`","--","\"\"","@@"],function(str) {
|
||||
var replace = str.split("").map(function(c) {
|
||||
|
||||
Reference in New Issue
Block a user