Browse Source

Correct starred sections and add test

pull/179/head
Oliverpool 9 years ago
parent
commit
1c47a23e57
  1. 2
      patacrep/content/__init__.py
  2. 2
      test/test_content/sections_short.control
  3. 2
      test/test_content/sections_short.source

2
patacrep/content/__init__.py

@ -174,7 +174,7 @@ def process_content(content, config=None):
""" """
contentlist = [] contentlist = []
plugins = config.get('_content_plugins', {}) plugins = config.get('_content_plugins', {})
keyword_re = re.compile(r'^ *(?P<keyword>\w*) *(\((?P<argument>.*)\))? *$') keyword_re = re.compile(r'^ *(?P<keyword>[\w\*]*) *(\((?P<argument>.*)\))? *$')
if not content: if not content:
content = [["song"]] content = [["song"]]
for elem in content: for elem in content:

2
test/test_content/sections_short.control

@ -1 +1 @@
["section:(tradi)Traditional", "exsong.sg", "section:Example", "texsong.tsg", "chordpro.csg", "exsong.sg"] ["section:(tradi)Traditional", "exsong.sg", "section*:Example", "texsong.tsg", "chordpro.csg", "exsong.sg"]

2
test/test_content/sections_short.source

@ -1,6 +1,6 @@
[["section", "Traditional", "tradi"], [["section", "Traditional", "tradi"],
"exsong.sg", "exsong.sg",
["section", "Example"], ["section*", "Example"],
"texsong.tsg", "texsong.tsg",
"chordpro.csg", "chordpro.csg",
"exsong.sg"] "exsong.sg"]
Loading…
Cancel
Save