Skip to content

Commit

Permalink
Numbers wrapped in <num>-tag.
Browse files Browse the repository at this point in the history
  • Loading branch information
nofont committed Jun 29, 2015
1 parent a4cc20f commit c6aa2e2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions typesetter/typesetter.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ var charReplacements = function() {
var quoteCharClose = "&raquo;";
var quoteCharOpen = "&laquo;";
var triggerID = "#display";
var smallcapsClass = "smallcaps"
var smallcapsClass = "num"

// END SETTINGS

Expand All @@ -44,7 +44,7 @@ var charReplacements = function() {
$(this).html( $(this).html().replace(/"([\s\.\,])/g, quoteCharClose + "$1")); // Replaces | " | space | with | » | space |
$(this).html( $(this).html().replace(/\s"/g, " " + quoteCharOpen)); // Replaces | space | " | with | space | « |

$(this).html( $(this).html().replace(/(\d+)(?=((?!<\/a>).)*(<a|$))/g, '<span class="' + smallcapsClass + '">$1</span>')); // wraps digits in <smallcaps>-tag but ignors digits within a <a>-tag. Read full explanation here http://www.phpbuilder.com/board/archive/index.php/t-10221442.html
$(this).html( $(this).html().replace(/(\d+)(?=((?!<\/a>).)*(<a|$))/g, '<' + smallcapsClass + '>$1</span>')); // wraps digits in <smallcaps>-tag but ignors digits within a <a>-tag. Read full explanation here http://www.phpbuilder.com/board/archive/index.php/t-10221442.html

if ( (($(this).children().length) === 0) || ($('this:contains("u00a9")')) ) {
$(this).html( $(this).html().replace(/\u00a9/g, "<sup class=\"sup\">&copy;</sup>") ); // Superscripts (c)
Expand Down

0 comments on commit c6aa2e2

Please sign in to comment.