Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Inline supports added #4

Merged
merged 2 commits into from almost 2 years ago

2 participants

Jonathan Alex Young
Jonathan

Hi !

I've added some inline elements supports (sup, sub, span, cite, code).

Alex Young
Owner

Nice! Thanks

Alex Young alexyoung merged commit f31c47f into from
Alex Young alexyoung closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.

Showing 2 changed files with 5 additions and 1 deletion. Show diff stats Hide diff stats

  1. +0 1  README.textile
  2. +5 0 lib/stextile.js
1  README.textile
Source Rendered
@@ -31,7 +31,6 @@ h3. TO-DO
31 31 * Benchmarks
32 32 * Optimisation
33 33 * Attributes for inline elements
34   -* span with %
35 34 * Indentation
36 35
37 36 h3. Notes
5 lib/stextile.js
@@ -302,6 +302,11 @@ Textile.prototype = {
302 302 text = text.replace(/_([^_]*)_(?![^<]*<\/)(?![^<]*>)/g, '<em>$1</em>');
303 303 text = text.replace(/\+([^+]*)\+(?![^<]*<\/)(?![^<]*>)/g, '<ins>$1</ins>');
304 304 text = text.replace(/\-([^+]*)\-(?![^<]*<\/)(?![^<]*>)/g, '<del>$1</del>');
  305 + text = text.replace(/\^([^+]*)\^(?![^<]*<\/)(?![^<]*>)/g, '<sup>$1</sup>');
  306 + text = text.replace(/\~([^+]*)\~(?![^<]*<\/)(?![^<]*>)/g, '<sub>$1</sub>');
  307 + text = text.replace(/\%([^+]*)\%(?![^<]*<\/)(?![^<]*>)/g, '<span>$1</span>');
  308 + text = text.replace(/@([^+]*)@(?![^<]*<\/)(?![^<]*>)/g, '<code>$1</code>');
  309 + text = text.replace(/\?\?([^+]*)\?\?(?![^<]*<\/)(?![^<]*>)/g, '<cite>$1</cite>');
305 310 text = this.replaceEntities(text);
306 311
307 312 return text;

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.