fix(formatting): Make formats parse specs as-is

This removes the spacing tinkering when parsing format specs.
The following example uses the old behavoir:

    format-test = <label-foo>  <label-bar>
    format-breaks = <label-foo><label-bar>/<bar-test>

`format-test` would replace all occurences of ' ' with the
a space string with defined `spacing` as its width. `format-breaks` would
not validate as the tags where split with ' ' as delimiter.

All that nonsense has been removed and each tag is extracted as is.
The `spacing` parameter can still be used to apply N extra whitespaces
between the tags, but it is now 0 by default.
This commit is contained in:
Michael Carlberg
2017-01-11 01:42:55 +01:00
parent f4e8051e9e
commit 30f516dd7d
9 changed files with 90 additions and 69 deletions

View File

@ -301,7 +301,11 @@ void builder::offset(int pixels) {
* Insert spaces
*/
void builder::space(size_t width) {
m_output.append(width, ' ');
if (width) {
m_output.append(width, ' ');
} else {
space();
}
}
void builder::space() {
m_output.append(m_bar.spacing, ' ');