-
-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Do not double escape text when processing markdown.
- Loading branch information
Showing
12 changed files
with
115 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,17 @@ | ||
# frozen_string_literal: true | ||
|
||
class String | ||
def to_permalink | ||
str = dup.unicode_normalize(:nfkd) | ||
str = str.gsub(/[^\x00-\x7F]/, "").to_s | ||
str.gsub!(/[^-\w]+/xim, "-") | ||
str.gsub!(/-+/xm, "-") | ||
str.gsub!(/^-?(.*?)-?$/, '\1') | ||
str.downcase! | ||
str | ||
module Kitabu | ||
module Extensions | ||
refine String do | ||
def to_permalink | ||
str = dup.unicode_normalize(:nfkd) | ||
str = str.gsub(/[^\x00-\x7F]/, "").to_s | ||
str.gsub!(/[^-\w]+/xim, "-") | ||
str.gsub!(/-+/xm, "-") | ||
str.gsub!(/^-?(.*?)-?$/, '\1') | ||
str.downcase! | ||
str | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- | ||
en: | ||
contents: Contents | ||
left_blank: This page intentionally left blank | ||
chapter: Chapter | ||
|
||
alerts: | ||
warning: Warning! | ||
note: Just so you know… | ||
tip: Here’s a tip! | ||
caution: Caution! | ||
important: Important! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters