Remove unneeded guards

Syntax will always return a grammar and tokenizing
with the null grammar is acceptable.
This commit is contained in:
Kevin Sawicki
2013-05-10 12:12:25 -07:00
parent 26dad65c8d
commit 642427d015

View File

@@ -75,13 +75,11 @@ class MarkdownPreviewView extends ScrollView
continue unless className = codeBlock.attr('class')
fenceName = className.replace(/^lang-/, '')
# go to next block unless the class name is matches `lang`
# go to next block unless the class name matches `lang`
continue unless extension = fenceNameToExtension[fenceName]
text = codeBlock.text()
# go to next block if this grammar is not mapped
continue unless grammar = syntax.selectGrammar("foo.#{extension}", text)
continue if grammar is syntax.nullGrammar
grammar = syntax.selectGrammar("foo.#{extension}", text)
codeBlock.empty()
for tokens in grammar.tokenizeLines(text)