Switch to tabs for indentation

I got drunk, read the coffeescript style guide, and decided to use
spaces. Spaces for indentation is still as bad an idea as it ever were,
and this is not a coffeescript project - it's multilingual, hence using
coffeescript conventions is pointless.
This commit is contained in:
Vit Brunner
2013-06-15 16:55:27 +01:00
parent 577993ec99
commit 8c777c5301
12 changed files with 192 additions and 188 deletions
+12 -12
View File
@@ -1,16 +1,16 @@
angular.module("sideBySide").factory("jsonReader", () ->
return (source) ->
parsed = eval('(' + source + ')')
return (source) ->
parsed = eval('(' + source + ')')
new_content = []
for verse in parsed.content
if typeof(verse) == "string"
new_content.push({ section: "", text: verse })
else
if "section" not of verse
verse.section = ""
new_content.push(verse)
new_content = []
for verse in parsed.content
if typeof(verse) == "string"
new_content.push({ section: "", text: verse })
else
if "section" not of verse
verse.section = ""
new_content.push(verse)
parsed.content = new_content
return parsed
parsed.content = new_content
return parsed
)
@@ -1,45 +1,45 @@
angular.module("sideBySide").factory("markdownReader", () ->
return (source) ->
read_meta = (block, inlineLexer) ->
meta = {}
lexed = inlineLexer.output(block.text)
for line in lexed.split("\n")
match = /([^:]*):(.*)/.exec(line)
meta[match[1].trim()] = match[2].trim()
return meta
return (source) ->
read_meta = (block, inlineLexer) ->
meta = {}
lexed = inlineLexer.output(block.text)
for line in lexed.split("\n")
match = /([^:]*):(.*)/.exec(line)
meta[match[1].trim()] = match[2].trim()
return meta
read_content = (lexed) ->
get_section = (lexed) ->
items = []
while lexed.length > 0
if lexed[0]["type"] == "heading"
break
items.push(lexed.shift())
return items
read_content = (lexed) ->
get_section = (lexed) ->
items = []
while lexed.length > 0
if lexed[0]["type"] == "heading"
break
items.push(lexed.shift())
return items
content = []
content = []
while lexed.length > 0
if lexed[0]["type"] == "heading"
heading = lexed.shift().text
else
heading = ''
while lexed.length > 0
if lexed[0]["type"] == "heading"
heading = lexed.shift().text
else
heading = ''
text = get_section(lexed)
text.links = lexed.links
content.push({
section: heading
text: marked.parser(text)
})
text = get_section(lexed)
text.links = lexed.links
content.push({
section: heading
text: marked.parser(text)
})
return content
return content
lexed = marked.lexer(source)
meta = lexed.shift()
inlineLexer = new marked.InlineLexer(lexed.links)
lexed = marked.lexer(source)
meta = lexed.shift()
inlineLexer = new marked.InlineLexer(lexed.links)
return {
meta: read_meta(meta, inlineLexer)
content: read_content(lexed)
}
return {
meta: read_meta(meta, inlineLexer)
content: read_content(lexed)
}
)