mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
Clean up string replacement
This commit is contained in:
parent
d9aff3c3f4
commit
1d905bd5ff
1 changed files with 7 additions and 4 deletions
|
@ -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('') + ']'
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue