Skip to content

Commit 9e3a59b

Browse files
author
Kaneko Yuto
committed
Allow attributes related to footnotes
1 parent a052901 commit 9e3a59b

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
## Unreleased
22

3+
- Avoid sanitizing attributes related to footnotes
4+
35
## 1.0.1
46

57
- Chenge qiita_marker from development dependency to runtime dependency

lib/qiita/markdown/transformers/filter_attributes.rb

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
module Qiita
24
module Markdown
35
module Transformers
@@ -7,6 +9,7 @@ class FilterAttributes
79
"class" => %w[autolink],
810
"rel" => %w[footnote url],
911
"rev" => %w[footnote],
12+
"id" => /\Afnref-.+\z/,
1013
},
1114
"blockquote" => {
1215
"class" => Embed::Tweet::CLASS_NAME,
@@ -17,15 +20,18 @@ class FilterAttributes
1720
"p" => {
1821
"class" => Embed::CodePen::CLASS_NAME,
1922
},
23+
"section" => {
24+
"class" => %w[footnotes],
25+
},
2026
"sup" => {
2127
"id" => /\Afnref\d+\z/,
2228
},
2329
"li" => {
24-
"id" => /\Afn\d+\z/,
30+
"id" => /\Afn.+\z/,
2531
},
2632
}.freeze
2733

28-
DELIMITER = " ".freeze
34+
DELIMITER = " "
2935

3036
def self.call(**args)
3137
new(**args).transform

0 commit comments

Comments
 (0)