mirror of
https://git.eworm.de/cgit/routeros-scripts
synced 2025-08-18 16:49:08 +02:00
mod/notification-telegram: support excluding characters from escaping...
... to support formatting in plain text. Handle with care, this can break the request if done wrong!
This commit is contained in:
parent
4b6cd7ba29
commit
f8856ae742
1 changed files with 4 additions and 1 deletions
|
@ -83,6 +83,7 @@
|
||||||
:local EscapeMD do={
|
:local EscapeMD do={
|
||||||
:local Text [ :tostr $1 ];
|
:local Text [ :tostr $1 ];
|
||||||
:local Mode [ :tostr $2 ];
|
:local Mode [ :tostr $2 ];
|
||||||
|
:local Excl [ :tostr $3 ];
|
||||||
|
|
||||||
:global CharacterReplace;
|
:global CharacterReplace;
|
||||||
:global IfThenElse;
|
:global IfThenElse;
|
||||||
|
@ -93,7 +94,9 @@
|
||||||
"#"; "+"; "-"; "="; "|"; "{"; "}"; "."; "!" };
|
"#"; "+"; "-"; "="; "|"; "{"; "}"; "."; "!" };
|
||||||
}
|
}
|
||||||
:foreach Char in=($Chars->$Mode) do={
|
:foreach Char in=($Chars->$Mode) do={
|
||||||
:set Text [ $CharacterReplace $Text $Char ("\\" . $Char) ];
|
:if ([ :typeof [ :find $Excl $Char ] ] = "nil") do={
|
||||||
|
:set Text [ $CharacterReplace $Text $Char ("\\" . $Char) ];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
:if ($Mode = "body") do={
|
:if ($Mode = "body") do={
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue