Skip to content

fix(plugins): Fix broken character encoding when replacing table cells #214

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 7, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
source "https://rubygems.org"

gem "jekyll", "~> 3.8.6"
gem "nokogiri", "~> 1.10.4"
gem "liquid-c"

group :development do
Expand Down
4 changes: 0 additions & 4 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,7 @@ GEM
rb-inotify (~> 0.9, >= 0.9.7)
ruby_dep (~> 1.2)
mercenary (0.3.6)
mini_portile2 (2.4.0)
multipart-post (2.1.1)
nokogiri (1.10.5)
mini_portile2 (~> 2.4.0)
pathutil (0.16.2)
forwardable-extended (~> 2.6)
premonition (2.0.0)
Expand Down Expand Up @@ -84,7 +81,6 @@ DEPENDENCIES
jekyll-redirect-from
jekyll-sitemap
liquid-c
nokogiri (~> 1.10.4)
premonition (~> 2.0.0)
rake
tzinfo (~> 1.2)
Expand Down
14 changes: 1 addition & 13 deletions _plugins/jekyll-table-markdown-attribute.rb
Original file line number Diff line number Diff line change
@@ -1,15 +1,3 @@
require 'jekyll'
require 'nokogiri'

Jekyll::Hooks.register [:pages, :documents], :pre_render do |post|
doc = Nokogiri::HTML.fragment(post.content)

# Stop if we could't parse with HTML
return content unless doc

doc.css('td').each do |td|
td.set_attribute('markdown', 'span')
end

post.content = doc.to_s
post.content = post.content.gsub('<td>', '<td markdown="span">')
end