Skip to content

Instantly share code, notes, and snippets.

@pgoodman
Created January 1, 2009 18:27
Show Gist options
  • Save pgoodman/42318 to your computer and use it in GitHub Desktop.
Save pgoodman/42318 to your computer and use it in GitHub Desktop.
(print (parse ':html "prefix text<div class=\"post\"><a name=\"comment-{$comment.comment_ID}\" id=\"comment-{$comment.comment_ID}\"></a>{$comment.content}<ul class=\"categories\">by <cond:if var=\"comment.comment_author_url\" neq=\"\"><a href=\"{$comment.comment_author_url}\" title=\"{$comment.comment_author}\">{$comment.comment_author}</a><cond:else />{$comment.comment_author}</cond:if> on {$comment.date} </ul></div>postfix text"))
;; what's generated:
("prefix text" (:HTML-TAG "" (:HTML-TAG-NAME "div") (:HTML-ATTRS (:HTML-ATTR "class" "post")) "") "" (:HTML-TAG "" (:HTML-TAG-NAME "a") (:HTML-ATTRS (:HTML-ATTR "name" "comment-{$comment.comment_ID}") (:HTML-ATTR "id" "comment-{$comment.comment_ID}")) "") "" (:HTML-TAG "/" (:HTML-TAG-NAME "a") (:HTML-ATTRS) "") "{$comment.content}" (:HTML-TAG "" (:HTML-TAG-NAME "ul") (:HTML-ATTRS (:HTML-ATTR "class" "categories")) "") "by " (:HTML-TAG "" (:HTML-TAG-NAME "cond:if") (:HTML-ATTRS (:HTML-ATTR "var" "comment.comment_author_url") (:HTML-ATTR "neq" "")) "") "" (:HTML-TAG "" (:HTML-TAG-NAME "a") (:HTML-ATTRS (:HTML-ATTR "href" "{$comment.comment_author_url}") (:HTML-ATTR "title" "{$comment.comment_author}")) "") "{$comment.comment_author}" (:HTML-TAG "/" (:HTML-TAG-NAME "a") (:HTML-ATTRS) "") "" (:HTML-TAG "" (:HTML-TAG-NAME "cond:else") (:HTML-ATTRS (:HTML-ATTR)) "/") "{$comment.comment_author}" (:HTML-TAG "/" (:HTML-TAG-NAME "cond:if") (:HTML-ATTRS) "") " on {$comment.date} " (:HTML-TAG "/" (:HTML-TAG-NAME "ul") (:HTML-ATTRS) "") "" (:HTML-TAG "/" (:HTML-TAG-NAME "div") (:HTML-ATTRS) "") "postfix text")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment