@peaceroad/markdown-it-strong-ja 0.2.0 → 0.2.1

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.
package/index.js CHANGED
@@ -82,11 +82,6 @@ const mdStrongJa = (md) => {
82
82
  md.inline.ruler.before('emphasis', 'strong_ja', (state, silent) => {
83
83
  strongJa(state, silent, md)
84
84
  })
85
- /*
86
- md.inline.ruler.before('emphasis', 'em_ja', (state, silent) => {
87
- emJa(state, silent, md)
88
- })*/
89
-
90
85
 
91
86
  md.core.ruler.push('remove_strong_ja_sp_chars', (state) => {
92
87
  let i = 0
@@ -98,12 +93,14 @@ const mdStrongJa = (md) => {
98
93
  }
99
94
  //console.log(state.tokens[i].children)
100
95
  if (state.tokens[i].children) {
101
- if(state.tokens[i].children[state.tokens[i].children.length - 1]) {
102
- if (state.tokens[i].children[state.tokens[i].children.length - 1].content) {
103
- if(state.tokens[i].children[state.tokens[i].children.length - 1].content === '★mdStrongJa★*') {
104
- //console.log(state.tokens[i].children[state.tokens[i].children.length - 1])
105
- state.tokens[i].children.pop()
96
+ if (state.tokens[i].children[state.tokens[i].children.length - 1]) {
97
+ let j = state.tokens[i].children.length - 1
98
+ while (j > -1) {
99
+ if (state.tokens[i].children[j].content === '★mdStrongJa★*') {
100
+ state.tokens[i].children.splice(j, 1)
101
+ break
106
102
  }
103
+ j--
107
104
  }
108
105
  }
109
106
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@peaceroad/markdown-it-strong-ja",
3
3
  "description": "This is a plugin for markdown-it. It is an alternative to the standard `**` (strong) and `*` (em) processing. It also processes strings that cannot be converted by the standard.",
4
- "version": "0.2.0",
4
+ "version": "0.2.1",
5
5
  "main": "index.js",
6
6
  "type": "module",
7
7
  "scripts": {
@@ -174,3 +174,32 @@ HTMLは*「Hyper[Text] <b>Markup</b> Language」*
174
174
  <ul>
175
175
  <li>HTMLは<em>「Hyper[Text] Markup Language」</em></li>
176
176
  </ul>
177
+
178
+ [Markdown]
179
+ HTMLは*「Hyper[Text](https://example.com/) Markup Language」*
180
+ [HTML]
181
+ <p>HTMLは<em>「Hyper<a href="https://example.com/">Text</a> Markup Language」</em></p>
182
+
183
+ [Markdown]
184
+ HTMLは[*HyperText Markup Language*](https://example.com/)
185
+ [HTML]
186
+ <p>HTMLは<a href="https://example.com/"><em>HyperText Markup Language</em></a></p>
187
+
188
+ [Markdown]
189
+ HTMLは[*「HyperText Markup Language」*](https://example.com/)
190
+ [HTML]
191
+ <p>HTMLは<a href="https://example.com/"><em>「HyperText Markup Language」</em></a></p>
192
+
193
+ [Markdown]
194
+ HTMLは[*「HyperText Markup Language」*][]です。
195
+
196
+ [*「HyperText Markup Language」*]: https://example.com/
197
+ [HTML]
198
+ <p>HTMLは<a href="https://example.com/"><em>「HyperText Markup Language」</em></a>です。</p>
199
+
200
+ [Markdown]
201
+ - HTMLは*「Hyper[Text](https://example.com/) Markup Language」*
202
+ [HTML]
203
+ <ul>
204
+ <li>HTMLは<em>「Hyper<a href="https://example.com/">Text</a> Markup Language」</em></li>
205
+ </ul>
@@ -170,3 +170,33 @@ HTMLは**「Hyper[Text] <b>Markup</b> Language」**
170
170
  <ul>
171
171
  <li>HTMLは<strong>「Hyper[Text] Markup Language」</strong></li>
172
172
  </ul>
173
+
174
+
175
+ [Markdown]
176
+ HTMLは**「Hyper[Text](https://example.com/) Markup Language」**
177
+ [HTML]
178
+ <p>HTMLは<strong>「Hyper<a href="https://example.com/">Text</a> Markup Language」</strong></p>
179
+
180
+ [Markdown]
181
+ HTMLは[**HyperText Markup Language**](https://example.com/)
182
+ [HTML]
183
+ <p>HTMLは<a href="https://example.com/"><strong>HyperText Markup Language</strong></a></p>
184
+
185
+ [Markdown]
186
+ HTMLは[**「HyperText Markup Language」**](https://example.com/)
187
+ [HTML]
188
+ <p>HTMLは<a href="https://example.com/"><strong>「HyperText Markup Language」</strong></a></p>
189
+
190
+ [Markdown]
191
+ HTMLは[**「HyperText Markup Language」**][]です。
192
+
193
+ [**「HyperText Markup Language」**]: https://example.com/
194
+ [HTML]
195
+ <p>HTMLは<a href="https://example.com/"><strong>「HyperText Markup Language」</strong></a>です。</p>
196
+
197
+ [Markdown]
198
+ - HTMLは**「Hyper[Text](https://example.com/) Markup Language」**
199
+ [HTML]
200
+ <ul>
201
+ <li>HTMLは<strong>「Hyper<a href="https://example.com/">Text</a> Markup Language」</strong></li>
202
+ </ul>
package/test/test.js CHANGED
@@ -14,7 +14,7 @@ const check = (ms, example) => {
14
14
  let n = 1
15
15
  while (n < ms.length) {
16
16
  //if (n !== 13) { n++; continue }
17
- //if (n !== 2) { n++; continue }
17
+ //if (n !== 28) { n++; continue }
18
18
  const m = ms[n].markdown
19
19
 
20
20
  console.log('Test [' + n + ', HTML: false] >>>')