diff options
-rw-r--r-- | data/templates/default.html4 | 4 | ||||
-rw-r--r-- | data/templates/default.html5 | 4 | ||||
-rw-r--r-- | src/Text/Pandoc/Writers/HTML.hs | 3 |
3 files changed, 7 insertions, 4 deletions
diff --git a/data/templates/default.html4 b/data/templates/default.html4 index deba57a7b..d54c48ee4 100644 --- a/data/templates/default.html4 +++ b/data/templates/default.html4 @@ -13,8 +13,8 @@ $endif$ $if(keywords)$ <meta name="keywords" content="$for(keywords)$$keywords$$sep$, $endfor$" /> $endif$ -$if(description)$ - <meta name="description" content="$description$" /> +$if(description-meta)$ + <meta name="description" content="$description-meta$" /> $endif$ <title>$if(title-prefix)$$title-prefix$ – $endif$$pagetitle$</title> <style type="text/css"> diff --git a/data/templates/default.html5 b/data/templates/default.html5 index dd7dc3212..9699b8504 100644 --- a/data/templates/default.html5 +++ b/data/templates/default.html5 @@ -13,8 +13,8 @@ $endif$ $if(keywords)$ <meta name="keywords" content="$for(keywords)$$keywords$$sep$, $endfor$" /> $endif$ -$if(description)$ - <meta name="description" content="$description$" /> +$if(description-meta)$ + <meta name="description" content="$description-meta$" /> $endif$ <title>$if(title-prefix)$$title-prefix$ – $endif$$pagetitle$</title> <style> diff --git a/src/Text/Pandoc/Writers/HTML.hs b/src/Text/Pandoc/Writers/HTML.hs index 9f9a1013c..c93322953 100644 --- a/src/Text/Pandoc/Writers/HTML.hs +++ b/src/Text/Pandoc/Writers/HTML.hs @@ -254,6 +254,8 @@ pandocToHtml opts (Pandoc meta blocks) = do let stringifyHTML = escapeStringForXML . stringify let authsMeta = map stringifyHTML $ docAuthors meta let dateMeta = stringifyHTML $ docDate meta + let descriptionMeta = escapeStringForXML $ + lookupMetaString "description" meta slideVariant <- gets stSlideVariant let sects = adjustNumbers opts $ makeSections (writerNumberSections opts) Nothing $ @@ -352,6 +354,7 @@ pandocToHtml opts (Pandoc meta blocks) = do defField "author-meta" authsMeta . maybe id (defField "date-meta") (normalizeDate dateMeta) . + defField "description-meta" descriptionMeta . defField "pagetitle" (stringifyHTML . docTitle $ meta) . defField "idprefix" (writerIdentifierPrefix opts) . |