# HG changeset patch # User Josef 'Jeff' Sipek # Date 1532962743 14400 # Mon Jul 30 10:59:03 2018 -0400 # Node ID 6435f2f8f9181c677db9fdfd42e60937b6966772 # Parent 2232d653c080c2aa7d04104a240813a4d61745a3 post fmt3: add \twitterphoto with behavior identical to the old \twitterimg Signed-off-by: Josef 'Jeff' Sipek diff --git a/post_fmt3.l b/post_fmt3.l --- a/post_fmt3.l +++ b/post_fmt3.l @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011-2017 Josef 'Jeff' Sipek + * Copyright (c) 2011-2018 Josef 'Jeff' Sipek * * 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 @@ "\\tag{" { BEGIN(SPECIALCMD); return TAGSTART; } "\\category{" { BEGIN(SPECIALCMD); return CATSTART; } "\\twitterimg{" { BEGIN(SPECIALCMD); return TWITTERIMGSTART; } +"\\twitterphoto{" { BEGIN(SPECIALCMD); return TWITTERPHOTOSTART; } "}" { BEGIN(INITIAL); return SPECIALCMDEND; } . { yylval->ptr = STR_DUP(yytext); return VERBTEXT; } diff --git a/post_fmt3.y b/post_fmt3.y --- a/post_fmt3.y +++ b/post_fmt3.y @@ -158,6 +158,7 @@ %token VERBSTART VERBEND DOLLAR %token LISTSTART LISTEND %token TITLESTART TAGSTART CATSTART PUBSTART TWITTERIMGSTART +%token TWITTERPHOTOSTART %token SPECIALCMDEND %type paragraphs paragraph thing cmd cmdarg optcmdarg math mexpr @@ -210,6 +211,8 @@ | 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); }