Skip to content

Commit

Permalink
Merge pull request #5 from steven-kraft/Reduce-Limitations
Browse files Browse the repository at this point in the history
Reduce limitations
  • Loading branch information
steven-kraft committed May 13, 2021
2 parents 4ccc79a + d20ec1c commit ddc637f
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 3 deletions.
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@ module.exports = {
"@typescript-eslint"
],
"rules": {
"no-useless-escape": "off"
}
};
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

Simple markdown to furigana rendering plugin for displaying Japanese text with [furigana](https://en.wikipedia.org/wiki/Furigana) in Obsidian (https://obsidian.md).

**As of 1.2.0, the plugin is no longer limited to Japanese Text**

Based off of [markdown-it-ruby](https://github.com/lostandfound/markdown-it-ruby) syntax. All rendering is done post-processing when previewing, so your notes are not modified.

### Examples
Expand All @@ -10,6 +12,10 @@ Markdown|Processed As|Displays As
---|---|---
{漢字\|かんじ}|`<ruby>漢字<rt>かんじ</rt></ruby>`|<ruby>漢字<rt>かんじ</rt></ruby>
{漢字\|かん\|じ}|`<ruby>漢<rt>かん</rt>字<rt>じ</rt></ruby>`|<ruby>漢<rt>かん</rt>字<rt>じ</rt></ruby>
{北京\|ㄅㄟˇ\|ㄐㄧㄥ}|`<ruby>北<rt>ㄅㄟˇ\</rt>京<rt>ㄐㄧㄥ</rt></ruby>`|<ruby>北<rt>ㄅㄟˇ\</rt>京<rt>ㄐㄧㄥ</rt></ruby>
{北京|Běi|jīng}|`<ruby>北<rt>Běi</rt>京<rt>jīng</rt></ruby>`|<ruby>北<rt>Běi</rt>京<rt>jīng</rt></ruby>
{韓國|한|국}|`<ruby>韓<rt>한</rt>國<rt>국</rt></ruby>`|<ruby>韓<rt>한</rt>國<rt>국</rt></ruby>


### Additional Info

Expand Down
2 changes: 1 addition & 1 deletion main.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Plugin, MarkdownPostProcessor, MarkdownPostProcessorContext } from 'obsidian'

// Regular Expression for {{kanji|kana|kana|...}} format
const REGEXP = /{((?:[一-龯]|[ぁ-んァ-ン])+)((?:\|[ぁ-んァ-ン]*)+)}/gm
const REGEXP = /{((?:[\u4E00-\u9FFFㄅ-ㄩぁ-んァ-ン])+)((?:\|[^ -\/{-~:-@\[-`]*)+)}/gm

// Main Tags to search for Furigana Syntax
const TAGS = 'p, h1, h2, h3, h4, h5, h6, ol, ul, table'
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "obsidian-markdown-furigana",
"name": "Markdown Furigana",
"version": "1.1.3",
"version": "1.2.0",
"minAppVersion": "0.9.12",
"description": "Simple Markdown to Furigana Rendering Plugin for Obsidian.",
"author": "Steven Kraft",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "obsidian-markdown-furigana",
"version": "1.1.3",
"version": "1.2.0",
"description": "Simple Markdown to Furigana Rendering Plugin for Obsidian.",
"main": "main.js",
"scripts": {
Expand Down

0 comments on commit ddc637f

Please sign in to comment.