Comparing version 2.1.1 to 3.0.0
@@ -5,1 +5,2 @@ # Authors ordered by first contribution | ||
* Alasdair Mercer <mercer.alasdair@gmail.com> | ||
* Tim Chaplin <tjchaplin@hotmail.com> |
@@ -1,6 +0,12 @@ | ||
2013.05.06, Version 2.1.1 | ||
## Version 3.0.0, 2013.08.15 | ||
* [#30](https://github.com/neocotic/html.md/issues/30): Rename command from `md` to `html-md` | ||
* [#31](https://github.com/neocotic/html.md/issues/31): Correct expectations of void elements | ||
* Update versions of dependencies | ||
## Version 2.1.1, 2013.05.06 | ||
* [#24](https://github.com/neocotic/html.md/issues/24): Add `base` option to specify the base URL used to resolve relative URLs | ||
2013.05.03, Version 2.1.0 | ||
## Version 2.1.0, 2013.05.03 | ||
@@ -22,3 +28,3 @@ * [#18](https://github.com/neocotic/html.md/issues/18): Add support for [bower][] installations | ||
2013.02.04, Version 2.0.2 | ||
## Version 2.0.2, 2013.02.04 | ||
@@ -28,7 +34,7 @@ * [#13](https://github.com/neocotic/html.md/issues/13): Add new man page | ||
2012.12.12, Version 2.0.1 | ||
## Version 2.0.1, 2012.12.12 | ||
* [#8](https://github.com/neocotic/html.md/issues/8): Fix incorrect version | ||
2012.12.11, Version 2.0.0 | ||
## Version 2.0.0, 2012.12.11 | ||
@@ -35,0 +41,0 @@ * [#1](https://github.com/neocotic/html.md/issues/1): Check inline style attribute to see if elements are hidden |
{ | ||
"name": "html-md", | ||
"version": "2.1.1", | ||
"version": "3.0.0", | ||
"main": "dist/md.min.js" | ||
} |
@@ -13,2 +13,3 @@ # Contributing | ||
* Fork the repository on GitHub | ||
* Read the `INSTALL.md` file | ||
@@ -27,13 +28,14 @@ ## Making Changes | ||
* Make sure your commit messages are in the proper format | ||
* Avoid updating the distributable file or annotated source code documentation | ||
``` | ||
(#99999) Make the example in CONTRIBUTING imperative and concrete | ||
(#99999) Make the example in CONTRIBUTING imperative and concrete | ||
Without this patch applied the example commit message in the CONTRIBUTING document is not a | ||
concrete example. This is a problem because the contributor is left to imagine what the commit | ||
message should look like based on a description rather than an example. This patch fixes the | ||
problem by making the example concrete and imperative. | ||
Without this patch applied the example commit message in the CONTRIBUTING document is not a | ||
concrete example. This is a problem because the contributor is left to imagine what the commit | ||
message should look like based on a description rather than an example. This patch fixes the | ||
problem by making the example concrete and imperative. | ||
The first line is a real life imperative statement with a ticket number from our issue tracker. | ||
The body describes the behavior without the patch, why this is a problem, and how the patch | ||
fixes the problem when applied. | ||
The first line is a real life imperative statement with a ticket number from our issue tracker. The | ||
body describes the behavior without the patch, why this is a problem, and how the patch fixes the | ||
problem when applied. | ||
``` | ||
@@ -46,5 +48,3 @@ * Make sure you have added the necessary tests for your changes | ||
* Ensure you added your details to `AUTHORS.md` in the correct format | ||
``` | ||
* Joe Bloggs <joe.bloggs@example.com> | ||
``` | ||
`Joe Bloggs <joe.bloggs@example.com>` | ||
* Push your changes to a topic branch in your fork of the repository | ||
@@ -51,0 +51,0 @@ * Submit a pull request to neocotic's repository |
@@ -1,3 +0,3 @@ | ||
/*! html-md v2.1.1 | (c) 2013 Alasdair Mercer | MIT License | ||
/*! html-md v3.0.0 | (c) 2013 Alasdair Mercer | MIT License | ||
Make.text v1.5 | (c) 2007 Trevor Jim | ||
*/ (function(){var t,e,i,s,n,r,o,h,a,u,p,l,c,d,f={}.hasOwnProperty,E=this;t={absolute:!1,base:"undefined"!=typeof window&&null!==window?window.document.baseURI:"file://"+process.cwd(),debug:!1,inline:!1},i=this.md,n={"\\\\":"\\\\","\\[":"\\[","\\]":"\\]",">":"\\>",_:"\\_","\\*":"\\*","`":"\\`","#":"\\#","([0-9])\\.(\\s|$)":"$1\\.$2","©":"(c)","®":"(r)","™":"(tm)"," ":" ","·":"\\*"," ":" "," ":" "," ":" ","‘":"'","’":"'","“":'"',"”":'"',"…":"...","–":"--","—":"---"},r=/(display|visibility)\s*:\s*[a-z]+/gi,o=/(none|hidden)\s*$/i,h=/^(APPLET|AREA|AUDIO|BUTTON|CANVAS|COMMAND|DATALIST|EMBED|HEAD|INPUT|KEYGEN|MAP|MENU|METER|NOFRAMES|NOSCRIPT|OBJECT|OPTGROUP|OPTION|PARAM|PROGRESS|RP|RT|RUBY|SCRIPT|SELECT|SOURCE|STYLE|TEXTAREA|TITLE|TRACK|VIDEO)$/,a=/^(ADDRESS|ARTICLE|ASIDE|DIV|FIELDSET|FOOTER|HEADER|NAV|P|SECTION)$/,s=function(){c={};for(u in n)f.call(n,u)&&(c[u]=RegExp(u,"g"));return c}(),l=function(t,e,i){var s,n;if(null==t&&(t=""),null==e&&(e=0),null==i&&(i=" "),!i)return t;for(s=n=0;e>=0?e>n:n>e;s=e>=0?++n:--n)t=i+t;return t},d=function(t){return null==t&&(t=""),t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")},e=function(){function e(e,i){var s,n;this.html=null!=e?e:"",this.options=null!=i?i:{},this.atLeft=this.atNoWS=this.atP=!0,this.buffer="",this.exceptions=[],this.order=1,this.listDepth=0,this.inCode=this.inPre=this.inOrderedList=!1,this.last=null,this.left="\n",this.links=[],this.linkMap={},this.unhandled={},"object"!=typeof this.options&&(this.options={});for(u in t)f.call(t,u)&&(s=t[u],this.options[u]===void 0&&(this.options[u]=s));this.win="undefined"!=typeof window&&null!==window?window:null,null==this.win&&(n=require("jsdom").jsdom(null,null,{features:{FetchExternalResources:!1},url:this.options.base}),this.win=n.createWindow())}return e.prototype.append=function(t){return null!=this.last&&(this.buffer+=this.last),this.last=t},e.prototype.attr=function(t,e,i){var s;return null==i&&(i=!0),s=i||"function"!=typeof t.getAttribute?t[e]:t.getAttribute(e),null!=s?s:""},e.prototype.br=function(){return this.append(" "+this.left),this.atLeft=this.atNoWS=!0},e.prototype.code=function(){var t,e=this;return t=this.inCode,this.inCode=!0,function(){return e.inCode=t}},e.prototype.has=function(t,e,i){return null==i&&(i=!0),i||"function"!=typeof t.hasAttribute?t.hasOwnProperty(e):t.hasAttribute(e)},e.prototype.inCodeProcess=function(t){return t.replace(/`/g,"\\`")},e.prototype.isVisible=function(t){var e,i,s,n,h,a,u,p,l;if(h=this.attr(t,"style",!1),s=null!=h?h.match(r):void 0,u=!0,null!=s)for(p=0,l=s.length;l>p;p++)n=s[p],u=!o.test(n);if(u&&"function"==typeof this.win.getComputedStyle)try{h=this.win.getComputedStyle(t,null),"function"==typeof(null!=h?h.getPropertyValue:void 0)&&(e=h.getPropertyValue("display"),a=h.getPropertyValue("visibility"),u="none"!==e&&"hidden"!==a)}catch(c){i=c,this.thrown(i,"getComputedStyle")}return u},e.prototype.li=function(){var t;return t=this.inOrderedList?""+this.order++ +". ":"* ",t=l(t,2*(this.listDepth-1)),this.append(t)},e.prototype.nonPreProcess=function(t){var e;t=t.replace(/\n([ \t]*\n)+/g,"\n"),t=t.replace(/\n[ \t]+/g,"\n"),t=t.replace(/[ \t]+/g," ");for(u in n)f.call(n,u)&&(e=n[u],t=t.replace(s[u],e));return t},e.prototype.ol=function(){var t,e,i=this;return 0===this.listDepth&&this.p(),t=this.inOrderedList,e=this.order,this.inOrderedList=!0,this.order=1,this.listDepth++,function(){return i.inOrderedList=t,i.order=e,i.listDepth--}},e.prototype.output=function(t){return t&&(this.inPre||(t=this.atNoWS?t.replace(/^[ \t\n]+/,""):/^[ \t]*\n/.test(t)?t.replace(/^[ \t\n]+/,"\n"):t.replace(/^[ \t]+/," ")),""!==t)?(this.atP=/\n\n$/.test(t),this.atLeft=/\n$/.test(t),this.atNoWS=/[ \t\n]$/.test(t),this.append(t.replace(/\n/g,this.left))):void 0},e.prototype.outputLater=function(t){var e=this;return function(){return e.output(t)}},e.prototype.p=function(){return this.atP?void 0:(this.atLeft||(this.append(this.left),this.atLeft=!0),this.append(this.left),this.atNoWS=this.atP=!0)},e.prototype.parse=function(){var t,e,i,s,n,r,o,h;if(this.buffer="",!this.html)return this.buffer;if(t=this.win.document.createElement("div"),"string"==typeof this.html?t.innerHTML=this.html:t.appendChild(this.html),this.process(t),this.links.length)for(this.append("\n\n"),h=this.links,e=r=0,o=h.length;o>r;e=++r)i=h[e],i&&this.append("["+e+"]: "+i+"\n");return this.options.debug&&(n=function(){var t,e;t=this.unhandled,e=[];for(s in t)f.call(t,s)&&e.push(s);return e}.call(this).sort(),console.log(n.length?"Ignored tags;\n"+n.join(", "):"No tags were ignored"),console.log(this.exceptions.length?"Exceptions;\n"+this.exceptions.join("\n"):"No exceptions were thrown")),this.append(""),this.buffer=d(this.buffer)},e.prototype.pre=function(){var t,e=this;return t=this.inPre,this.inPre=!0,function(){return e.inPre=t}},e.prototype.process=function(t){var e,i,s,n,r,o,u,p,l,c,d,f,E,y,m,b,g,N,L;if(this.isVisible(t)){if(t.nodeType===this.win.Node.ELEMENT_NODE){l=!1;try{if(h.test(t.tagName))l=!0;else if(/^H[1-6]$/.test(t.tagName))p=parseInt(t.tagName.match(/([1-6])$/)[1]),this.p(),this.output(""+function(){var t,e;for(e=[],u=t=1;p>=1?p>=t:t>=p;u=p>=1?++t:--t)e.push("#");return e}().join("")+" ");else if(a.test(t.tagName))this.p();else switch(t.tagName){case"BODY":case"FORM":break;case"DETAILS":this.p(),this.has(t,"open",!1)||(l=!0,f=t.getElementsByTagName("summary")[0],f&&this.process(f));break;case"BR":this.br();break;case"HR":this.p(),this.output("---"),this.p();break;case"CITE":case"DFN":case"EM":case"I":case"U":case"VAR":this.output("_"),this.atNoWS=!0,e=this.outputLater("_");break;case"DT":case"B":case"STRONG":"DT"===t.tagName&&this.p(),this.output("**"),this.atNoWS=!0,e=this.outputLater("**");break;case"Q":this.output('"'),this.atNoWS=!0,e=this.outputLater('"');break;case"OL":case"UL":e="OL"===t.tagName?this.ol():this.ul();break;case"LI":this.li();break;case"PRE":i=this.pushLeft(" "),s=this.pre(),e=function(){return i(),s()};break;case"CODE":case"KBD":case"SAMP":if(this.inPre)break;this.output("`"),i=this.code(),s=this.outputLater("`"),e=function(){return i(),s()};break;case"BLOCKQUOTE":case"DD":e=this.pushLeft("> ");break;case"A":if(o=this.attr(t,"href",this.options.absolute),!o)break;E=this.attr(t,"title"),E&&(o+=' "'+E+'"'),d=this.options.inline?"("+o+")":"["+(null!=(g=(y=this.linkMap)[o])?g:y[o]=this.links.push(o)-1)+"]",this.output("["),this.atNoWS=!0,e=this.outputLater("]"+d);break;case"IMG":if(l=!0,c=this.attr(t,"src",this.options.absolute),!c)break;this.output("!["+this.attr(t,"alt")+"]("+c+")");break;case"FRAME":case"IFRAME":l=!0;try{(null!=(N=t.contentDocument)?N.documentElement:void 0)&&this.process(t.contentDocument.documentElement)}catch(P){r=P,this.thrown(r,"contentDocument")}break;case"TR":e=this.p;break;default:this.options.debug&&(this.unhandled[t.tagName]=null)}}catch(P){r=P,this.thrown(r,t.tagName)}if(!l)for(L=t.childNodes,m=0,b=L.length;b>m;m++)n=L[m],this.process(n);return null!=e?e.call(this):void 0}return t.nodeType===this.win.Node.TEXT_NODE?this.output(this.inPre?t.nodeValue:this.inCode?this.inCodeProcess(t.nodeValue):this.nonPreProcess(t.nodeValue)):void 0}},e.prototype.pushLeft=function(t){var e,i=this;return e=this.left,this.left+=t,this.atP?this.append(t):this.p(),function(){return i.left=e,i.atLeft=i.atP=!1,i.p()}},e.prototype.replaceLeft=function(t){return this.atLeft?this.last?this.last=this.last.replace(/[ ]{2,4}$/,t):void 0:(this.append(this.left.replace(/[ ]{2,4}$/,t)),this.atLeft=this.atNoWS=this.atP=!0)},e.prototype.thrown=function(t,e){return this.options.debug?this.exceptions.push(""+e+": "+t):void 0},e.prototype.ul=function(){var t,e,i=this;return 0===this.listDepth&&this.p(),t=this.inOrderedList,e=this.order,this.inOrderedList=!1,this.order=1,this.listDepth++,function(){return i.inOrderedList=t,i.order=e,i.listDepth--}},e}(),this.md=p=function(t,i){return new e(t,i).parse()},("undefined"!=typeof module&&null!==module?module.exports:void 0)?module.exports=p:"function"==typeof define&&define.amd&&define("md",function(){return p}),p.version=p.VERSION="2.1.1",p.noConflict=function(){return E.md=i,p}}).call(this); | ||
*/ !function(){var a,b,c,d,e,f,g,h,i,j,k,l,m,n,o={}.hasOwnProperty,p=this;a={absolute:!1,base:"undefined"!=typeof window&&null!==window?window.document.baseURI:"file://"+process.cwd(),debug:!1,inline:!1},c=this.md,e={"\\\\":"\\\\","\\[":"\\[","\\]":"\\]",">":"\\>",_:"\\_","\\*":"\\*","`":"\\`","#":"\\#","([0-9])\\.(\\s|$)":"$1\\.$2","©":"(c)","®":"(r)","™":"(tm)"," ":" ","·":"\\*"," ":" "," ":" "," ":" ","‘":"'","’":"'","“":'"',"”":'"',"…":"...","–":"--","—":"---"},f=/(display|visibility)\s*:\s*[a-z]+/gi,g=/(none|hidden)\s*$/i,h=/^(APPLET|AREA|AUDIO|BUTTON|CANVAS|DATALIST|EMBED|HEAD|INPUT|MAP|MENU|METER|NOFRAMES|NOSCRIPT|OBJECT|OPTGROUP|OPTION|PARAM|PROGRESS|RP|RT|RUBY|SCRIPT|SELECT|STYLE|TEXTAREA|TITLE|VIDEO)$/,i=/^(ADDRESS|ARTICLE|ASIDE|DIV|FIELDSET|FOOTER|HEADER|NAV|P|SECTION)$/,d=function(){m={};for(j in e)o.call(e,j)&&(m[j]=new RegExp(j,"g"));return m}(),l=function(a,b,c){var d,e;if(null==a&&(a=""),null==b&&(b=0),null==c&&(c=" "),!c)return a;for(d=e=0;b>=0?b>e:e>b;d=b>=0?++e:--e)a=c+a;return a},n=function(a){return null==a&&(a=""),a.trim?a.trim():a.replace(/^\s+|\s+$/g,"")},b=function(){function b(b,c){var d,e;this.html=null!=b?b:"",this.options=null!=c?c:{},this.atLeft=this.atNoWS=this.atP=!0,this.buffer="",this.exceptions=[],this.order=1,this.listDepth=0,this.inCode=this.inPre=this.inOrderedList=!1,this.last=null,this.left="\n",this.links=[],this.linkMap={},this.unhandled={},"object"!=typeof this.options&&(this.options={});for(j in a)o.call(a,j)&&(d=a[j],"undefined"==typeof this.options[j]&&(this.options[j]=d));this.win="undefined"!=typeof window&&null!==window?window:null,null==this.win&&(e=require("jsdom").jsdom(null,null,{features:{FetchExternalResources:!1},url:this.options.base}),this.win=e.createWindow())}return b.prototype.append=function(a){return null!=this.last&&(this.buffer+=this.last),this.last=a},b.prototype.attr=function(a,b,c){var d;return null==c&&(c=!0),d=c||"function"!=typeof a.getAttribute?a[b]:a.getAttribute(b),null!=d?d:""},b.prototype.br=function(){return this.append(" "+this.left),this.atLeft=this.atNoWS=!0},b.prototype.code=function(){var a,b=this;return a=this.inCode,this.inCode=!0,function(){return b.inCode=a}},b.prototype.has=function(a,b,c){return null==c&&(c=!0),c||"function"!=typeof a.hasAttribute?a.hasOwnProperty(b):a.hasAttribute(b)},b.prototype.inCodeProcess=function(a){return a.replace(/`/g,"\\`")},b.prototype.isVisible=function(a){var b,c,d,e,h,i,j,k,l;if(h=this.attr(a,"style",!1),d=null!=h?h.match(f):void 0,j=!0,null!=d)for(k=0,l=d.length;l>k;k++)e=d[k],j=!g.test(e);if(j&&"function"==typeof this.win.getComputedStyle)try{h=this.win.getComputedStyle(a,null),"function"==typeof(null!=h?h.getPropertyValue:void 0)&&(b=h.getPropertyValue("display"),i=h.getPropertyValue("visibility"),j="none"!==b&&"hidden"!==i)}catch(m){c=m,this.thrown(c,"getComputedStyle")}return j},b.prototype.li=function(){var a;return a=this.inOrderedList?""+this.order++ +". ":"* ",a=l(a,2*(this.listDepth-1)),this.append(a)},b.prototype.nonPreProcess=function(a){var b;a=a.replace(/\n([ \t]*\n)+/g,"\n"),a=a.replace(/\n[ \t]+/g,"\n"),a=a.replace(/[ \t]+/g," ");for(j in e)o.call(e,j)&&(b=e[j],a=a.replace(d[j],b));return a},b.prototype.ol=function(){var a,b,c=this;return 0===this.listDepth&&this.p(),a=this.inOrderedList,b=this.order,this.inOrderedList=!0,this.order=1,this.listDepth++,function(){return c.inOrderedList=a,c.order=b,c.listDepth--}},b.prototype.output=function(a){return a&&(this.inPre||(a=this.atNoWS?a.replace(/^[ \t\n]+/,""):/^[ \t]*\n/.test(a)?a.replace(/^[ \t\n]+/,"\n"):a.replace(/^[ \t]+/," ")),""!==a)?(this.atP=/\n\n$/.test(a),this.atLeft=/\n$/.test(a),this.atNoWS=/[ \t\n]$/.test(a),this.append(a.replace(/\n/g,this.left))):void 0},b.prototype.outputLater=function(a){var b=this;return function(){return b.output(a)}},b.prototype.p=function(){return this.atP?void 0:(this.atLeft||(this.append(this.left),this.atLeft=!0),this.append(this.left),this.atNoWS=this.atP=!0)},b.prototype.parse=function(){var a,b,c,d,e,f,g,h;if(this.buffer="",!this.html)return this.buffer;if(a=this.win.document.createElement("div"),"string"==typeof this.html?a.innerHTML=this.html:a.appendChild(this.html),this.process(a),this.links.length)for(this.append("\n\n"),h=this.links,b=f=0,g=h.length;g>f;b=++f)c=h[b],c&&this.append("["+b+"]: "+c+"\n");return this.options.debug&&(e=function(){var a,b;a=this.unhandled,b=[];for(d in a)o.call(a,d)&&b.push(d);return b}.call(this).sort(),console.log(e.length?"Ignored tags;\n"+e.join(", "):"No tags were ignored"),console.log(this.exceptions.length?"Exceptions;\n"+this.exceptions.join("\n"):"No exceptions were thrown")),this.append(""),this.buffer=n(this.buffer)},b.prototype.pre=function(){var a,b=this;return a=this.inPre,this.inPre=!0,function(){return b.inPre=a}},b.prototype.process=function(a){var b,c,d,e,f,g,j,k,l,m,n,o,p,q,r,s,t,u,v;if(this.isVisible(a)){if(a.nodeType===this.win.Node.ELEMENT_NODE){l=!1;try{if(h.test(a.tagName))l=!0;else if(/^H[1-6]$/.test(a.tagName))k=parseInt(a.tagName.match(/([1-6])$/)[1]),this.p(),this.output(""+function(){var a,b;for(b=[],j=a=1;k>=1?k>=a:a>=k;j=k>=1?++a:--a)b.push("#");return b}().join("")+" ");else if(i.test(a.tagName))this.p();else switch(a.tagName){case"BODY":case"FORM":break;case"DETAILS":this.p(),this.has(a,"open",!1)||(l=!0,o=a.getElementsByTagName("summary")[0],o&&this.process(o));break;case"BR":this.br();break;case"HR":this.p(),this.output("---"),this.p();break;case"CITE":case"DFN":case"EM":case"I":case"U":case"VAR":this.output("_"),this.atNoWS=!0,b=this.outputLater("_");break;case"DT":case"B":case"STRONG":"DT"===a.tagName&&this.p(),this.output("**"),this.atNoWS=!0,b=this.outputLater("**");break;case"Q":this.output('"'),this.atNoWS=!0,b=this.outputLater('"');break;case"OL":case"UL":b="OL"===a.tagName?this.ol():this.ul();break;case"LI":this.li();break;case"PRE":c=this.pushLeft(" "),d=this.pre(),b=function(){return c(),d()};break;case"CODE":case"KBD":case"SAMP":if(this.inPre)break;this.output("`"),c=this.code(),d=this.outputLater("`"),b=function(){return c(),d()};break;case"BLOCKQUOTE":case"DD":b=this.pushLeft("> ");break;case"A":if(g=this.attr(a,"href",this.options.absolute),!g)break;p=this.attr(a,"title"),p&&(g+=' "'+p+'"'),n=this.options.inline?"("+g+")":"["+(null!=(t=(q=this.linkMap)[g])?t:q[g]=this.links.push(g)-1)+"]",this.output("["),this.atNoWS=!0,b=this.outputLater("]"+n);break;case"IMG":if(l=!0,m=this.attr(a,"src",this.options.absolute),!m)break;this.output("!["+this.attr(a,"alt")+"]("+m+")");break;case"FRAME":case"IFRAME":l=!0;try{(null!=(u=a.contentDocument)?u.documentElement:void 0)&&this.process(a.contentDocument.documentElement)}catch(w){f=w,this.thrown(f,"contentDocument")}break;case"TR":b=this.p;break;default:this.options.debug&&(this.unhandled[a.tagName]=null)}}catch(w){f=w,this.thrown(f,a.tagName)}if(!l)for(v=a.childNodes,r=0,s=v.length;s>r;r++)e=v[r],this.process(e);return null!=b?b.call(this):void 0}return a.nodeType===this.win.Node.TEXT_NODE?this.output(this.inPre?a.nodeValue:this.inCode?this.inCodeProcess(a.nodeValue):this.nonPreProcess(a.nodeValue)):void 0}},b.prototype.pushLeft=function(a){var b,c=this;return b=this.left,this.left+=a,this.atP?this.append(a):this.p(),function(){return c.left=b,c.atLeft=c.atP=!1,c.p()}},b.prototype.replaceLeft=function(a){return this.atLeft?this.last?this.last=this.last.replace(/[ ]{2,4}$/,a):void 0:(this.append(this.left.replace(/[ ]{2,4}$/,a)),this.atLeft=this.atNoWS=this.atP=!0)},b.prototype.thrown=function(a,b){return this.options.debug?this.exceptions.push(""+b+": "+a):void 0},b.prototype.ul=function(){var a,b,c=this;return 0===this.listDepth&&this.p(),a=this.inOrderedList,b=this.order,this.inOrderedList=!1,this.order=1,this.listDepth++,function(){return c.inOrderedList=a,c.order=b,c.listDepth--}},b}(),this.md=k=function(a,c){return new b(a,c).parse()},("undefined"!=typeof module&&null!==module?module.exports:void 0)?module.exports=k:"function"==typeof define&&define.amd&&define("md",function(){return k}),k.version=k.VERSION="3.0.0",k.noConflict=function(){return p.md=c,k}}.call(this); |
@@ -1,6 +0,11 @@ | ||
# Build Requirements | ||
This document is only relevant for those that want to contribute to the [html.md][] open source | ||
project (we love you guys!). If you are only interested in installing the tool look at `README.md`. | ||
## Build Requirements | ||
In order to build [html.md][], you need to have the following install [git][] 1.7+ and [node.js][] | ||
0.6+ (which includes [npm][]). | ||
0.8+ (which includes [npm][]). | ||
# Building | ||
## Building | ||
Follow these steps to build [html.md][]; | ||
@@ -13,16 +18,23 @@ | ||
4. Ensure you can run [Grunt][] by running `npm install -g grunt-cli` | ||
5. For the compiled JavaScript `cd` run `grunt build` | ||
* Outputs `md.js` to the `lib` directory | ||
* Outputs `md.min.js` (compressed version) to the `dist` directory | ||
* Outputs documentation to the `docs` directory | ||
5. To update the compiled and runnable version enter `grunt build` | ||
* Outputs to the `lib` directory | ||
6. To run the full test suite enter `grunt test` | ||
* **Pro Tip:** You can easily run steps 5 and 6 back-to-back by just entering `grunt` | ||
7. To update the optimized distributable file and documentation enter `grunt dist` | ||
* This also compiles and tests all code to ensure the latest code is stable and used | ||
* Outputs to distributable file and documentation to the `dist` and `docs` directories | ||
respectively | ||
Simply running `grunt` will cause both the `build` and `test` tasks to be executed, in that order. | ||
If tests are failing and you require more details, just append `--stack` to the command for a full | ||
stack trace to be printed out (e.g. `grunt test --stack`). | ||
## Important | ||
If you're planning on contributing to [html.md][] please do **NOT** update the distributable file | ||
or documentation (step 7) when submitting a pull request. We will not accept pull requests when | ||
these files have been changed as we do this ourselves when finalizing a release. | ||
Read the `CONTRIBUTING.md` file for more information about submitting pull requests. | ||
[git]: http://git-scm.com | ||
[grunt]: http://gruntjs.com | ||
[html.md]: http://neocotic.com/html.md | ||
[node.js]: http://nodejs.org | ||
[npm]: http://npmjs.org | ||
[html.md]: http://neocotic.com/html.md |
@@ -112,3 +112,3 @@ (function() { | ||
parseOptions = function() { | ||
program.version(md.version).usage('Usage: md [options] [ -e html | <file ...> ]').option('-a, --absolute', 'always use absolute URLs for links and images').option('-b, --base <url>', 'set base URL to resolve relative URLs from').option('-d, --debug', 'print additional debug information').option('-e, --eval', 'pass a string from the command line as input').option('-i, --inline', 'generate inline style links').option('-l, --long-ext', 'use long extension for Markdown files').option('-o, --output <dir>', 'set the output directory for converted Markdown').option('-p, --print', 'print out the converted Markdown').parse(process.argv); | ||
program.version(md.version).usage('[options] [ -e html | <file ...> ]').option('-a, --absolute', 'always use absolute URLs for links and images').option('-b, --base <url>', 'set base URL to resolve relative URLs from').option('-d, --debug', 'print additional debug information').option('-e, --eval', 'pass a string from the command line as input').option('-i, --inline', 'generate inline style links').option('-l, --long-ext', 'use long extension for Markdown files').option('-o, --output <dir>', 'set the output directory for converted Markdown').option('-p, --print', 'print out the converted Markdown').parse(process.argv); | ||
if (program.longExt) { | ||
@@ -115,0 +115,0 @@ extension = '.markdown'; |
@@ -46,3 +46,3 @@ (function() { | ||
R_IGNORE_CHILDREN = /^(APPLET|AREA|AUDIO|BUTTON|CANVAS|COMMAND|DATALIST|EMBED|HEAD|INPUT|KEYGEN|MAP|MENU|METER|NOFRAMES|NOSCRIPT|OBJECT|OPTGROUP|OPTION|PARAM|PROGRESS|RP|RT|RUBY|SCRIPT|SELECT|SOURCE|STYLE|TEXTAREA|TITLE|TRACK|VIDEO)$/; | ||
R_IGNORE_CHILDREN = /^(APPLET|AREA|AUDIO|BUTTON|CANVAS|DATALIST|EMBED|HEAD|INPUT|MAP|MENU|METER|NOFRAMES|NOSCRIPT|OBJECT|OPTGROUP|OPTION|PARAM|PROGRESS|RP|RT|RUBY|SCRIPT|SELECT|STYLE|TEXTAREA|TITLE|VIDEO)$/; | ||
@@ -572,3 +572,3 @@ R_PARAGRAPH_ONLY = /^(ADDRESS|ARTICLE|ASIDE|DIV|FIELDSET|FOOTER|HEADER|NAV|P|SECTION)$/; | ||
md.version = md.VERSION = '2.1.1'; | ||
md.version = md.VERSION = '3.0.0'; | ||
@@ -575,0 +575,0 @@ md.noConflict = function() { |
@@ -1,2 +0,2 @@ | ||
Copyright (C) 2013 Alasdair Mercer, http://neocotic.com/ | ||
Copyright (C) 2013 Alasdair Mercer, http://neocotic.com | ||
@@ -3,0 +3,0 @@ Permission is hereby granted, free of charge, to any person obtaining a copy |
{ | ||
"name": "html-md", | ||
"description": "JavaScript library for converting HTML in to valid Markdown", | ||
"version": "2.1.1", | ||
"version": "3.0.0", | ||
"homepage": "http://neocotic.com/html.md", | ||
@@ -30,12 +30,12 @@ "bugs": { | ||
"dependencies": { | ||
"commander": "~1.1.1", | ||
"fs-extra": "~0.6.0", | ||
"jsdom": "~0.6.0" | ||
"commander": "~2.0.0", | ||
"fs-extra": "~0.6.3", | ||
"jsdom": "~0.8.3" | ||
}, | ||
"devDependencies": { | ||
"grunt": "~0.4.1", | ||
"grunt-contrib-clean": "~0.4.1", | ||
"grunt-contrib-clean": "~0.5.0", | ||
"grunt-contrib-coffee": "~0.7.0", | ||
"grunt-contrib-nodeunit": "~0.1.2", | ||
"grunt-contrib-uglify": "~0.2.0", | ||
"grunt-contrib-nodeunit": "~0.2.0", | ||
"grunt-contrib-uglify": "~0.2.2", | ||
"grunt-docco": "~0.2.0" | ||
@@ -46,7 +46,7 @@ }, | ||
}, | ||
"man": "man/md.1", | ||
"man": "man/html-md.1", | ||
"bin": { | ||
"md": "bin/md" | ||
"html-md": "bin/html-md" | ||
}, | ||
"main": "lib/md" | ||
} |
@@ -79,8 +79,8 @@ __ __ ___ __ | ||
# provide HTML to be converted and print it back out to stdout: | ||
$ md -epi "I <b>love</b> <a href='http://neocotic.com/html.md'>html.md</a>" | ||
$ html-md -epi "I <b>love</b> <a href='http://neocotic.com/html.md'>html.md</a>" | ||
I **love** [html.md](http://neocotic.com/html.md) | ||
# convert HTML files and output them into another directory: | ||
$ md -o ./markdown ./html/*.html | ||
$ html-md -o ./markdown ./html/*.html | ||
# convert all HTML files in the current directory into Markdown files: | ||
$ md -l . | ||
$ html-md -l . | ||
``` | ||
@@ -90,3 +90,3 @@ | ||
Usage: md [options] [ -e html | <file ...> ] | ||
Usage: html-md [options] [ -e html | <file ...> ] | ||
@@ -169,3 +169,3 @@ Options: | ||
``` javascript | ||
console.log(md.version); // "2.1.1" | ||
console.log(md.version); // "3.0.0" | ||
``` | ||
@@ -172,0 +172,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
223016
+ Addedcommander@2.0.0(transitive)
+ Addedjsdom@0.8.11(transitive)
+ Addedxmlhttprequest@1.8.0(transitive)
- Removedcommander@1.1.1(transitive)
- Removedcssom@0.2.5(transitive)
- Removedjsdom@0.6.5(transitive)
- Removedkeypress@0.1.0(transitive)
Updatedcommander@~2.0.0
Updatedfs-extra@~0.6.3
Updatedjsdom@~0.8.3