post fmt3: add \twitterphoto with behavior identical to the old \twitterimg

Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
2 files changed, 5 insertions(+), 1 deletions(-)

M post_fmt3.l
M post_fmt3.y
M post_fmt3.l +2 -1
@@ 1,5 1,5 @@ 
 /*
- * Copyright (c) 2011-2017 Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
+ * Copyright (c) 2011-2018 Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
  *
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this software and associated documentation files (the "Software"), to deal

          
@@ 71,6 71,7 @@ static void inc_lineno(yyscan_t scanner)
 "\\tag{"			{ BEGIN(SPECIALCMD); return TAGSTART; }
 "\\category{"			{ BEGIN(SPECIALCMD); return CATSTART; }
 "\\twitterimg{"			{ BEGIN(SPECIALCMD); return TWITTERIMGSTART; }
+"\\twitterphoto{"		{ BEGIN(SPECIALCMD); return TWITTERPHOTOSTART; }
 <SPECIALCMD>"}"			{ BEGIN(INITIAL); return SPECIALCMDEND; }
 <SPECIALCMD>.			{ yylval->ptr = STR_DUP(yytext); return VERBTEXT; }
 

          
M post_fmt3.y +3 -0
@@ 158,6 158,7 @@ static void special_cmd_list(struct pars
 %token VERBSTART VERBEND DOLLAR
 %token LISTSTART LISTEND
 %token TITLESTART TAGSTART CATSTART PUBSTART TWITTERIMGSTART
+%token TWITTERPHOTOSTART
 %token SPECIALCMDEND
 
 %type <ptr> paragraphs paragraph thing cmd cmdarg optcmdarg math mexpr

          
@@ 210,6 211,8 @@ thing : WORD				{ $$ = $1; }
       | CATSTART verb SPECIALCMDEND	{ $$ = NULL; special_cmd_list(data, &data->sc_cats, $2); }
       | TWITTERIMGSTART verb SPECIALCMDEND
 					{ $$ = NULL; special_cmd(data, &data->sc_twitter_img, $2, false); }
+      | TWITTERPHOTOSTART verb SPECIALCMDEND
+					{ $$ = NULL; special_cmd(data, &data->sc_twitter_img, $2, true); }
       ;
 
 cmd : WORD optcmdarg cmdarg	{ $$ = process_cmd(data, $1, $3, $2); }