geany/geany — pull request #319 by b4n (2014-08-19 14:59:09+00:00)
Title: Better txt2tags parser

New, improved Txt2tags parser, with fixed title handling and scoping support, fixing https://sourceforge.net/p/geany/feature-requests/690/

Reference for implementation: https://txt2tags.googlecode.com/svn/trunk/doc/English/rules.t2t

Test cases are from the official Txt2tags repository, under GPL (https://txt2tags.googlecode.com/svn/trunk/COPYING).

## What is wrong with the current parser

The current parser doesn't handle titles properly (yet it was the only thing it actually supported), doesn't support scope, and is really weird. It seems to have been copied from the Markdown one and modified with limited care to handle Txt2tags. It also has a weird case for "°" in the input, but the Txt2tags docs doesn't suggest it means anything -- and anyway the generated tags wouldn't be displayed in Geany (as we don't map *header1*). Also, handling of "°" was initially wrong, see a7e5fb3332454cbb1cc66fc982ecf149274dd783.