mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
WIP: blank out label commands before running spell-check
This commit is contained in:
parent
1ecabaa611
commit
a1d2d5b313
1 changed files with 11 additions and 0 deletions
|
@ -53,6 +53,9 @@ define [
|
||||||
@$scope.learnWord = (highlight) =>
|
@$scope.learnWord = (highlight) =>
|
||||||
@learnWord(highlight)
|
@learnWord(highlight)
|
||||||
|
|
||||||
|
# DEBUG
|
||||||
|
window.BLANK = @blankOutBlacklistedCommands
|
||||||
|
|
||||||
runFullCheck: () ->
|
runFullCheck: () ->
|
||||||
@highlightedWordManager.clearRows()
|
@highlightedWordManager.clearRows()
|
||||||
if @$scope.spellCheckLanguage and @$scope.spellCheckLanguage != ""
|
if @$scope.spellCheckLanguage and @$scope.spellCheckLanguage != ""
|
||||||
|
@ -217,6 +220,7 @@ define [
|
||||||
words = []
|
words = []
|
||||||
positions = []
|
positions = []
|
||||||
for line, row in lines
|
for line, row in lines
|
||||||
|
line = @blankOutBlacklistedCommands(line)
|
||||||
if !linesToProcess? or linesToProcess[row]
|
if !linesToProcess? or linesToProcess[row]
|
||||||
# Regex generated from /\\?['\p{L}]+/g via https://mothereff.in/regexpu.
|
# Regex generated from /\\?['\p{L}]+/g via https://mothereff.in/regexpu.
|
||||||
# \p{L} matches unicode characters in the 'letter' category, but is not supported until ES6.
|
# \p{L} matches unicode characters in the 'letter' category, but is not supported until ES6.
|
||||||
|
@ -246,3 +250,10 @@ define [
|
||||||
error: (xhr, status, error) ->
|
error: (xhr, status, error) ->
|
||||||
callback error
|
callback error
|
||||||
return $.ajax options
|
return $.ajax options
|
||||||
|
|
||||||
|
blankOutBlacklistedCommands: (line) ->
|
||||||
|
line.replace /\\label(\[[^\]]*\])?{[^}]*}/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('') + ']'
|
||||||
|
|
Loading…
Reference in a new issue