-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from aozorahack/accent_tag
--use-jisx0213 also suppot Accent_tag
- Loading branch information
Showing
3 changed files
with
25 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
class Accent_tag | ||
alias_method :to_s_orig, :to_s | ||
|
||
def self.use_jisx0213=(val) | ||
@use_jisx0213 = val | ||
end | ||
|
||
def self.use_jisx0213 | ||
@use_jisx0213 | ||
end | ||
|
||
def jisx0213_to_unicode(code) | ||
Aozora2Html::JIS2UCS[code] | ||
end | ||
|
||
def to_s | ||
if Accent_tag.use_jisx0213 | ||
jisx0213_to_unicode(@code.sub(%r|.*/|,"").to_sym) | ||
else | ||
to_s_orig | ||
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