mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-14 22:23:42 +01:00
Clean up string replacement
This commit is contained in:
+7
-4
@@ -253,7 +253,10 @@ define [
|
||||
|
||||
blankOutBlacklistedCommands: (line) ->
|
||||
line.replace /\\(label|ref|usepackage|begin|end)(\[[^\]]*\])?{[^}]*}/g, (command) ->
|
||||
command = command.replace /{.*}/, (args) ->
|
||||
'{' + args.slice(1, args.length-1).split('').map((_char)-> '.').join('') + '}'
|
||||
command.replace /\[.*\]/, (args) ->
|
||||
'[' + args.slice(1, args.length-1).split('').map((_char)-> '.').join('') + ']'
|
||||
command.replace(
|
||||
/{.*}/, (args) ->
|
||||
'{' + args.slice(1, args.length-1).split('').map((_char)-> '.').join('') + '}'
|
||||
).replace(
|
||||
/\[.*\]/, (args) ->
|
||||
'[' + args.slice(1, args.length-1).split('').map((_char)-> '.').join('') + ']'
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user