Mercurial > blahgd > fmt4
changeset 1132:6435f2f8f918 v4.5
post fmt3: add \twitterphoto with behavior identical to the old \twitterimg
Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
author | Josef 'Jeff' Sipek <jeffpc@josefsipek.net> |
---|---|
date | Mon, 30 Jul 2018 10:59:03 -0400 |
parents | 2232d653c080 |
children | 9a70df4e78e9 |
files | post_fmt3.l post_fmt3.y |
diffstat | 2 files changed, 5 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/post_fmt3.l Mon Jul 30 10:57:58 2018 -0400 +++ b/post_fmt3.l Mon Jul 30 10:59:03 2018 -0400 @@ -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 @@ "\\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; }
--- a/post_fmt3.y Mon Jul 30 10:57:58 2018 -0400 +++ b/post_fmt3.y Mon Jul 30 10:59:03 2018 -0400 @@ -158,6 +158,7 @@ %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 @@ | 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); }