Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix handling multiple definition descriptions
The following valid markdown code: Some term (DT) : Description (DD1). : Also description (DD2). is currently not handled correctly, resulting in this roff output .TP Some term (DT) Description (DD1). .TP Also description (DD2). In other words, the second definition description (DD2) is misrepresented as a separate definition title. This happens because the code is not looking into ListTypeTerm flag (perhaps it was not supported at the time of writing?), instead alternating between DT and DD (assuming DD goes after DT and vice versa), which is not the case if we have two DTs. The fix is to check the ListTypeTerm flag: if set, this is a DT, otherwise a DD. Unfortunately we still have to use a state variable. This is because the first DD should follow the DT immediately (i.e. no extra newlines or anything), while the subsequent DDs needs to be separated with an extra newline. With these fixes, the above input results in: .TP Some term (DT) Description (DD1). Also description (DD2). which is rendered by GNU troff + man macros to something like: Some term (DT) Description (DD1). Also description (DD2). Add a test case to verify the fix and avoid future regressions. Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
- Loading branch information