| 197 | } |
| 198 | |
| 199 | function inline(stream, state) { |
| 200 | var ch = stream.next(), |
| 201 | token = state.ctx.token; |
| 202 | |
| 203 | function finish(ch) { |
| 204 | state.ctx.prev = ch; |
| 205 | return token; |
| 206 | } |
| 207 | |
| 208 | if (ch != state.ctx.ch) { |
| 209 | return finish(ch); |
| 210 | } |
| 211 | |
| 212 | if (/\s/.test(state.ctx.prev)) { |
| 213 | return finish(ch); |
| 214 | } |
| 215 | |
| 216 | if (state.ctx.wide) { |
| 217 | ch = stream.next(); |
| 218 | |
| 219 | if (ch != state.ctx.ch) { |
| 220 | return finish(ch); |
| 221 | } |
| 222 | } |
| 223 | |
| 224 | if (!stream.eol() && !rePostInline.test(stream.peek())) { |
| 225 | if (state.ctx.wide) { |
| 226 | stream.backUp(1); |
| 227 | } |
| 228 | |
| 229 | return finish(ch); |
| 230 | } |
| 231 | |
| 232 | setState(state, normal); |
| 233 | setNormal(state, ch); |
| 234 | |
| 235 | return token; |
| 236 | } |
| 237 | |
| 238 | function directive(stream, state) { |
| 239 | var token = null; |