Skip to content

Commit

Permalink
fix end index check for eol issue (broken test added, then change app…
Browse files Browse the repository at this point in the history
…lied which fixed test)
  • Loading branch information
jay-hodgson committed Feb 26, 2016
1 parent 800b76b commit 41c4779
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 6 deletions.
4 changes: 2 additions & 2 deletions dist/markdown-it-center-text.js
@@ -1,4 +1,4 @@
/*! markdown-it-center-text 1.0.2 https://github.com/jay-hodgson/markdown-it-center-text @license MIT */(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.markdownitCentertext = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
/*! markdown-it-center-text 1.0.3 https://github.com/jay-hodgson/markdown-it-center-text @license MIT */(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.markdownitCentertext = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
// Process -> center text <-

'use strict';
Expand All @@ -10,7 +10,7 @@ module.exports = function centertext_plugin(md) {
max = state.posMax,
start = state.pos,
marker = state.src.charCodeAt(start);
if (start + 3 >= max) { return false; }
if (start + 1 > max) { return false; }
if (silent) { return false; } // don't run any pairs in validation mode

if (marker === 45/* - */ &&
Expand Down
4 changes: 2 additions & 2 deletions dist/markdown-it-center-text.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion index.js
Expand Up @@ -9,7 +9,7 @@ module.exports = function centertext_plugin(md) {
max = state.posMax,
start = state.pos,
marker = state.src.charCodeAt(start);
if (start + 3 >= max) { return false; }
if (start + 1 > max) { return false; }
if (silent) { return false; } // don't run any pairs in validation mode

if (marker === 45/* - */ &&
Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "markdown-it-center-text",
"version": "1.0.2",
"version": "1.0.3",
"description": "tag for markdown-it markdown parser.",
"main": "index.js",
"keywords": [
Expand Down
6 changes: 6 additions & 0 deletions test/fixtures/centertext.txt
Expand Up @@ -35,6 +35,12 @@ more text that is not centered<-
<p>more text that is not centered&lt;-</p>
.

.
## ->Centered heading<-
.
<h2><div style="text-align: center;">Centered heading</div></h2>
.

coverage
.
*~f
Expand Down

0 comments on commit 41c4779

Please sign in to comment.