|
@ -3,6 +3,8 @@ |
|
|
|
|
|
|
|
|
import plasTeX |
|
|
import plasTeX |
|
|
|
|
|
|
|
|
|
|
|
from songbook.plastex import processUnbreakableSpace |
|
|
|
|
|
|
|
|
def split_linebreak(texlist): |
|
|
def split_linebreak(texlist): |
|
|
return_list = [] |
|
|
return_list = [] |
|
|
current = [] |
|
|
current = [] |
|
@ -11,7 +13,7 @@ def split_linebreak(texlist): |
|
|
return_list.append(current) |
|
|
return_list.append(current) |
|
|
current = [] |
|
|
current = [] |
|
|
else: |
|
|
else: |
|
|
current.append(token.textContent.encode('utf-8')) |
|
|
current.append(processUnbreakableSpace(token).textContent.encode('utf-8')) |
|
|
if current: |
|
|
if current: |
|
|
return_list.append(current) |
|
|
return_list.append(current) |
|
|
return return_list |
|
|
return return_list |
|
@ -31,7 +33,7 @@ class beginsong(plasTeX.Command): |
|
|
args = {} |
|
|
args = {} |
|
|
for (key, val) in self.attributes['args'].iteritems(): |
|
|
for (key, val) in self.attributes['args'].iteritems(): |
|
|
if isinstance(val, plasTeX.DOM.Element): |
|
|
if isinstance(val, plasTeX.DOM.Element): |
|
|
args[key] = val.textContent.encode('utf-8') |
|
|
args[key] = processUnbreakableSpace(val).textContent.encode('utf-8') |
|
|
elif isinstance(val, unicode): |
|
|
elif isinstance(val, unicode): |
|
|
args[key] = val.encode('utf-8') |
|
|
args[key] = val.encode('utf-8') |
|
|
elif isinstance(val, str): |
|
|
elif isinstance(val, str): |
|
|