qiita-markdown 0.1.8 → 0.1.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of qiita-markdown might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0a51a261ae49b1f70422fd8bdc369a74f6642af5
4
- data.tar.gz: 4a60fcc69702d2bb73eeed3a0e05b1cdedbcc93d
3
+ metadata.gz: 646c0bedfa5fea9408f5fe772ec60ad3d833b827
4
+ data.tar.gz: a87e1268456c60fc54c65469e711ba03a1e8cc84
5
5
  SHA512:
6
- metadata.gz: 415b4b139299e1d7a66f9d8940e6eb4f498bdb38680f94841b270abb8d37f12f6593830b7ea75f1acb16f86a260c5934f4a224000592d204e6bec1666c77feb7
7
- data.tar.gz: d5e627bced5f6ea45a5d755f8f6930b2053de23b0e44857cce03167f3c4412ca78229ede162a04e114b705ad72bdb95bdd39a8a035c3f28c109f27458003b646
6
+ metadata.gz: 02035cc6cadbe363d2537606d89bdbb2027d5489d43e948b722b20a033bfe9fa8a23d9cd6c4a2852abf9fcbe2a02db1748af454b1638af54704c3d01bdfff705
7
+ data.tar.gz: e0dc79ed2c31d8037801265d8008e5292736394889b63a2fbdac25cb8218b415bd5c72dcafe975e8115228aa78f8e0b187191caf69a0fc3e3ceb4a7b02476406
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ## 0.1.9
2
+ - Fix a bug that raised error while rendering links with absolute URI inside of `<sup>` tag (e.g. `<sup>[Qiita](http://qiita.com/)</sup>`)
3
+
1
4
  ## 0.1.8
2
5
  - Add title attribute into footnote link element
3
6
 
data/README.md CHANGED
@@ -10,6 +10,7 @@ Qiita-specified markdown processor.
10
10
  * Syntax highlighting
11
11
  * Mention
12
12
  * Task list
13
+ * Footnotes
13
14
 
14
15
  ## Usage
15
16
  Qiita::Markdown::Processor provides markdown rendering logic.
@@ -4,7 +4,8 @@ module Qiita
4
4
  class Footnote < HTML::Pipeline::Filter
5
5
  def call
6
6
  doc.search("sup > a").each do |a|
7
- if li = doc.search(a["href"]).first
7
+ href = a["href"]
8
+ if href.start_with?("#") && (li = doc.search(href).first)
8
9
  a[:title] = li.text.gsub(/\A\n/, "").gsub(/ ↩\n\z/, "")
9
10
  end
10
11
  end
@@ -1,5 +1,5 @@
1
1
  module Qiita
2
2
  module Markdown
3
- VERSION = "0.1.8"
3
+ VERSION = "0.1.9"
4
4
  end
5
5
  end
@@ -528,5 +528,19 @@ describe Qiita::Markdown::Processor do
528
528
  EOS
529
529
  end
530
530
  end
531
+
532
+ context 'with manually written link inside of <sup> tag' do
533
+ let(:markdown) do
534
+ <<-EOS.strip_heredoc
535
+ <sup>[Qiita](http://qiita.com/)</sup>
536
+ EOS
537
+ end
538
+
539
+ it "does not confuse the structure with automatically generated footnote reference" do
540
+ should eq <<-EOS.strip_heredoc
541
+ <p><sup><a href="http://qiita.com/">Qiita</a></sup></p>
542
+ EOS
543
+ end
544
+ end
531
545
  end
532
546
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: qiita-markdown
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8
4
+ version: 0.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryo Nakamura
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-17 00:00:00.000000000 Z
11
+ date: 2014-12-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport