Remove XML PI and trailing newline from ditaa svg
This commit is contained in:
parent
125e1e1416
commit
e06748dac0
|
@ -68,6 +68,8 @@ def expand_ditaa(m, context, directory):
|
|||
else:
|
||||
svg = subprocess.check_output(['ditaa', '-T', '--svg', '-'], input=ditaa_source.encode('utf-8'))
|
||||
svg = svg.decode('utf-8')
|
||||
svg = re.sub(r'<\?xml.*?\?>', '', svg)
|
||||
svg = svg.strip()
|
||||
cache.cursor().execute('INSERT INTO diagrams VALUES (?, ?)', (ditaa_source, svg))
|
||||
cache.cursor().execute('COMMIT')
|
||||
|
||||
|
|
Loading…
Reference in New Issue