Mercurial > blahgd > fmt4
changeset 1196:8d8864b0fe6d draft
WIP: post fmt4: bold, italics, underline command handlers
Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
author | Josef 'Jeff' Sipek <jeffpc@josefsipek.net> |
---|---|
date | Sun, 30 Dec 2018 13:42:37 -0500 |
parents | edf137597c9d |
children | c32be880f0d1 |
files | ast_cmd_biu.c |
diffstat | 1 files changed, 51 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ast_cmd_biu.c Sun Dec 30 13:42:37 2018 -0500 @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2013-2017 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 + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +#include "ast.h" + +/* + * Handle bold, italics, and underline. + */ + +static struct str *ast_cmds_biu(list_t *mand, list_t *opt, const char *open, + const char *close) +{ + ASSERT(list_is_empty(opt)); + //XXX: ASSERT(mand has 1 element); + + +} + +struct str *ast_cmds_textbf(struct astnode *in, list_t *mand, list_t *opt) +{ + return cmd_biu(mand, opt, "<b>", "</b>"); +} + +struct str *ast_cmds_textit(struct astnode *in, list_t *mand, list_t *opt) +{ + return cmd_biu(mand, opt, "<i>", "</i>"); +} + +struct str *ast_cmds_emph(struct astnode *in, list_t *mand, list_t *opt) +{ + return cmd_biu(mand, opt, "<em>", "</em>"); +}