mirror of
https://github.com/Orc/discount.git
synced 2026-09-25 04:10:00 +03:00
Fix clipping of table captions where there are trailing spaces on the line
This commit is contained in:
+1
-1
@@ -1535,7 +1535,7 @@ printtable(Paragraph *pp, MMIOT *f)
|
||||
Qstring("<table>\n", f);
|
||||
if ( caption ) {
|
||||
Qstring("<caption>", f);
|
||||
___mkd_reparse(T(caption->text)+1, S(caption->text)-2, 0, f, 0);
|
||||
___mkd_reparse(T(caption->text)+1, mkd_lastnonblank(caption)-1, 0, f, 0);
|
||||
Qstring("</caption>\n", f);
|
||||
}
|
||||
Qstring("<thead>\n", f);
|
||||
|
||||
+3
-3
@@ -82,8 +82,8 @@ mkd_firstnonblank(Line *p)
|
||||
|
||||
/* find the last nonblank character on the line
|
||||
*/
|
||||
static int
|
||||
lastnonblank(Line *p)
|
||||
int
|
||||
mkd_lastnonblank(Line *p)
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -1175,7 +1175,7 @@ ___mkd_tablecaption(Line *pp)
|
||||
{
|
||||
return pp && S(pp->text)
|
||||
&& (T(pp->text)[pp->dle] == '[')
|
||||
&& (T(pp->text)[lastnonblank(pp)] == ']');
|
||||
&& (T(pp->text)[mkd_lastnonblank(pp)] == ']');
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -166,6 +166,7 @@ struct string_stream {
|
||||
|
||||
|
||||
extern int mkd_firstnonblank(Line *);
|
||||
extern int mkd_lastnonblank(Line *);
|
||||
extern int mkd_compile(Document *, DWORD);
|
||||
extern int mkd_document(Document *, char **);
|
||||
extern int mkd_generatehtml(Document *, FILE *);
|
||||
|
||||
Reference in New Issue
Block a user