Skip to content

Commit 21f4daa

Browse files
hardingbitschmidty
authored andcommitted
Plugins/auto-anchor: no auto anchors/links in email format mode
1 parent 0484e86 commit 21f4daa

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

_plugins/auto-anchor.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@
88
# - [Summary](URL): Details
99

1010
Jekyll::Hooks.register :documents, :pre_render do |post|
11-
## Don't process documents if YAML headers say: "auto_id: false"
12-
if post.data["auto_id"] != false
11+
## Don't process documents if YAML headers say: "auto_id: false" or
12+
## we're formatting for email
13+
unless post.data["auto_id"] == false || ENV['JEKYLL_ENV'] == 'email'
1314
post.content.gsub!(/^ *- .*/) do |string|
1415
## Find shortest match for **bold**, *italics*, or [markdown][links]
1516
title = string.match(/\*\*.*?\*\*|\*.*?\*|\[.*?\][(\[]/).to_s

0 commit comments

Comments
 (0)