Proper use of BR and P tags
authorKris Kowal <kris.kowal@cixar.com>
Fri, 31 Aug 2012 22:30:04 +0000 (15:30 -0700)
committerKris Kowal <kris.kowal@cixar.com>
Fri, 31 Aug 2012 22:30:04 +0000 (15:30 -0700)
tengwar-annatar.js
vanilla-tengwar.min.js

index 83cdf39..17c11dc 100644 (file)
@@ -525,7 +525,7 @@ exports.transcribe = transcribe;
 function transcribe(sections) {
     return sections.map(function (section) {
         return section.map(function (paragraph) {
-            return paragraph.map(function (line) {
+            return "<p>" + paragraph.map(function (line) {
                 return line.map(function (word) {
                     return word.map(function (column) {
                         var tengwa = column.tengwa || "anna";
@@ -544,7 +544,7 @@ function transcribe(sections) {
                         return html;
                     }).join("");
                 }).join(" ");;
-            }).join("\n");
+            }).join("<br>\n") + "</p>";
         }).join("\n\n");
     }).join("\n\n\n");
 }
index 5f1c607..2e4e705 100644 (file)
@@ -29,12 +29,13 @@ o:3,u:3,"\u00f3":2,"\u00fa":2,y:null,others:1},arda:{a:1,e:3,i:1,o:3,u:3,"\u00ed
 ure:{e:3,o:3,u:3,"\u00f3":3,"\u00fa":3,others:1},halla:{others:null},"short-carrier":3,"long-carrier":{y:null,others:3},"round-carrier":3,"tinco-extended":3,"parma-extended":3,"calma-extended":{o:3,u:7,"\u00f3":2,"\u00fa":2,others:1},"quesse-extended":{o:0,u:7,others:1}},punctuation:{"-":"comma",",":"comma",":":"comma",";":"full-stop",".":"full-stop","!":"exclamation-point","?":"question-mark","(":"open-paren",")":"close-paren",">":"flourish-left","<":"flourish-right"},annotations:{tinco:{tengwa:"t"},
 parma:{tengwa:"p"},calma:{tengwa:"c"},quesse:{tengwa:"c"},ando:{tengwa:"d"},umbar:{tengwa:"b"},anga:{tengwa:"ch"},ungwe:{tengwa:"g"},thule:{tengwa:"th"},formen:{tengwa:"f"},hyarmen:{tengwa:"h"},hwesta:{tengwa:"kh"},unque:{tengwa:"gh"},anto:{tengwa:"dh"},anca:{tengwa:"j"},ampa:{tengwa:"v"},numen:{tengwa:"n"},malta:{tengwa:"m"},nwalme:{tengwa:"\u00f1"},romen:{tengwa:"r"},ore:{tengwa:"-r"},lambe:{tengwa:"l"},silme:{tengwa:"s"},"silme-nuquerna":{tengwa:"s"},esse:{tengwa:"z"},"esse-nuquerna":{tengwa:"z"},
 harma:{tengwa:"sh"},alda:{tengwa:"lh"},arda:{tengwa:"rh"},wilya:{tengwa:"a"},vala:{tengwa:"w"},anna:{tengwa:"i"},vala:{tengwa:"w"},yanta:{tengwa:"e"},"hwesta-sindarinwa":{tengwa:"wh"},s:{following:"s"},"s-inverse":{following:"s<sub>2</sub>"},"s-extended":{following:"s<sub>3</sub>"},"s-flourish":{following:"s<sub>4</sub>"},"long-carrier":{tengwa:"\u00b4"},"short-carrier":{},"tilde-above":{above:"nm\u00f1-"},"tilde-below":{below:"2"},a:{"tehta-above":"a"},e:{"tehta-above":"e"},i:{"tehta-above":"i"},
-o:{"tehta-above":"o"},u:{"tehta-above":"u"},"\u00f3":{"tehta-above":"\u00f3"},"\u00fa":{"tehta-above":"\u00fa"},"\u00ed":{"tehta-above":"y"},y:{"tehta-below":"y"},w:{"tehta-above":"w"},"full-stop":{tengwa:"."},"exclamation-point":{tengwa:"!"},"question-mark":{tengwa:"?"},comma:{tengwa:"-"},"open-paren":{tengwa:"("},"close-paren":{tengwa:")"},"flourish-left":{tengwa:"\u201c"},"flourish-right":{tengwa:"\u201d"}}};j.transcribe=function(a){return a.map(function(a){return a.map(function(a){return a.map(function(a){return a.map(function(a){return a.map(function(a){var c=
-a.tengwa||"anna",d=[];a.above&&d.push(a.above);a.below&&d.push(a.below);a.tildeBelow&&d.push("tilde-below");a.tildeAbove&&d.push("tilde-above");a.following&&d.push(a.following);d=g.tengwar[c]+d.map(function(a){return x(c,a)}).join("");a.errors&&(d='<abbr class="error" title="'+a.errors.join("\n").replace(/"/g,"&quot;")+'">'+d+"</abbr>");return d}).join("")}).join(" ")}).join("\n")}).join("\n\n")}).join("\n\n\n")};j.tehtaForTengwa=x;j.makeColumn=function(a,e,c){return new i(a,e,c)};var i=function(a,
-e,c){this.above=e;this.tildeAbove=void 0;this.tengwa=a;this.tildeBelow=void 0;this.below=c;this.error=this.following=void 0};i.prototype.canAddAbove=function(){return!this.above||("silme"===this.tengwa||"esse"===this.tengwa)&&!this.below};i.prototype.addAbove=function(a){"silme"===this.tengwa&&(this.tengwa="silme-nuquerna");"esse"===this.tengwa&&(this.tengwa="esse-nuquerna");this.above=a;return this};i.prototype.canAddBelow=function(){return!this.below&&"silme-nuquerna"!==this.tengwa};i.prototype.addBelow=
-function(a){this.below=a;return this};i.prototype.addTildeAbove=function(){this.tildeAbove=!0;return this};i.prototype.addTildeBelow=function(){this.tildeBelow=!0;return this};i.prototype.addFollowing=function(a){this.following=a;return this};i.prototype.addError=function(a){this.errors=this.errors||[];this.errors.push(a);return this};var l={module$exports:function(a,e){e=e||function(a){throw Error(a);};return function(c){var f,d=a.apply(null,[function(a){f=a;var c=e;return function(a){""!==a&&c("Unexpected "+
-JSON.stringify(a));return function O(){return O}}}].concat(Array.prototype.slice.call(arguments,1)));for(Array.prototype.forEach.call(c,function(a){d=d(a)});!f;)d=d("");return f}}};l.module$exports&&(l=l.module$exports);var m={module$exports:function(a){return a.replace($,function(a,c){return L[c]})}},L={k:"c",x:"cs",qu:"cw",q:"cw",ph:"f",bh:"v","\u00eb":"e","\u00e2":"\u00e1","\u00ea":"\u00e9","\u00ee":"\u00ed","\u00f4":"\u00f3","\u00fb":"\u00fa"},$=RegExp("("+Object.keys(L).join("|")+")","ig");m.module$exports&&
-(m=m.module$exports);var n={module$exports:{"-":"comma",",":"comma",":":"comma",";":"full-stop",".":"full-stop","!":"exclamation-point","?":"question-mark","(":"open-paren",")":"close-paren",">":"flourish-left","<":"flourish-right"}};n.module$exports&&(n=n.module$exports);var w={encode:function(a){return a.map(function(a){return a.map(function(a){return a.map(function(a){return a.map(function(a){return a.map(function(a){var c=[];a.above&&c.push(a.above);a.below&&c.push(a.below);a.following&&c.push(a.following);
-a.tildeAbove&&c.push("tilde-above");a.tildeBelow&&c.push("tilde-below");return c.length?a.tengwa+":"+c.join(","):a.tengwa}).join(";")}).join(" ")}).join("\n")}).join("\n\n")}).join("\n\n\n")},decode:function(a,e){return a.split("\n\n\n").map(function(a){return a.split("\n\n").map(function(a){return a.split("\n").map(function(a){return a.split(" ").map(function(a){return y(a,e)})})})})}};w.decodeWord=y;var o={},N=j,B=w,P=m,C=n,M={};o.transcribe=function(a,e){e=r(e);return e.font.transcribe(s(a,e))};
-o.encode=function(a,e){e=r(e);return B.encode(s(a,e))};o.parse=s;var A={iant:"yanta;tinco:a,tilde-above",iaur:"yanta;vala:a;ore",baranduiniant:"umbar;romen:a;ando:a,tilde-above;anna:u;yanta;anto:a,tilde-above",ioreth:"yanta;romen:o;thule:e",noldo:"nwalme;lambe:o;ando;short-carrier:o",noldor:"nwalme;lambe:o;ando;ore:o",is:"short-carrier:i,s"},Q=l(function(a,e){return D(a,e,[])}),t="aeiou\u00f3\u00fa",p={"\u00e1":"a","\u00e9":"e","\u00ed":"i","\u00f3":"o","\u00fa":"u"};o.parseTengwaAnnotations=k;var S=
-["tinco","parma","short-carrier","lambe"],q={},U=j,W=m,F=n,T={};q.transcribe=function(a,e){e=u(e);return e.font.transcribe(v(a,e))};q.encode=function(a,e){e=u(e);return w.encode(v(a,e))};q.parse=v;var V=l(function(a,e){return G(a,e,[])}),I="aeiouy\u00e1\u00e9\u00ed\u00f3\u00fa",Y=o,Z=q,X=j,K=Array.prototype;document.querySelectorAll&&K.forEach&&("complete"===document.readyState?J():document.addEventListener("DOMContentLoaded",J,!0))})();
+o:{"tehta-above":"o"},u:{"tehta-above":"u"},"\u00f3":{"tehta-above":"\u00f3"},"\u00fa":{"tehta-above":"\u00fa"},"\u00ed":{"tehta-above":"y"},y:{"tehta-below":"y"},w:{"tehta-above":"w"},"full-stop":{tengwa:"."},"exclamation-point":{tengwa:"!"},"question-mark":{tengwa:"?"},comma:{tengwa:"-"},"open-paren":{tengwa:"("},"close-paren":{tengwa:")"},"flourish-left":{tengwa:"\u201c"},"flourish-right":{tengwa:"\u201d"}}};j.transcribe=function(a){return a.map(function(a){return a.map(function(a){return"<p>"+
+a.map(function(a){return a.map(function(a){return a.map(function(a){var c=a.tengwa||"anna",d=[];a.above&&d.push(a.above);a.below&&d.push(a.below);a.tildeBelow&&d.push("tilde-below");a.tildeAbove&&d.push("tilde-above");a.following&&d.push(a.following);d=g.tengwar[c]+d.map(function(a){return x(c,a)}).join("");a.errors&&(d='<abbr class="error" title="'+a.errors.join("\n").replace(/"/g,"&quot;")+'">'+d+"</abbr>");return d}).join("")}).join(" ")}).join("<br>\n")+"</p>"}).join("\n\n")}).join("\n\n\n")};
+j.tehtaForTengwa=x;j.makeColumn=function(a,e,c){return new i(a,e,c)};var i=function(a,e,c){this.above=e;this.tildeAbove=void 0;this.tengwa=a;this.tildeBelow=void 0;this.below=c;this.error=this.following=void 0};i.prototype.canAddAbove=function(){return!this.above||("silme"===this.tengwa||"esse"===this.tengwa)&&!this.below};i.prototype.addAbove=function(a){"silme"===this.tengwa&&(this.tengwa="silme-nuquerna");"esse"===this.tengwa&&(this.tengwa="esse-nuquerna");this.above=a;return this};i.prototype.canAddBelow=
+function(){return!this.below&&"silme-nuquerna"!==this.tengwa};i.prototype.addBelow=function(a){this.below=a;return this};i.prototype.addTildeAbove=function(){this.tildeAbove=!0;return this};i.prototype.addTildeBelow=function(){this.tildeBelow=!0;return this};i.prototype.addFollowing=function(a){this.following=a;return this};i.prototype.addError=function(a){this.errors=this.errors||[];this.errors.push(a);return this};var l={module$exports:function(a,e){e=e||function(a){throw Error(a);};return function(c){var f,
+d=a.apply(null,[function(a){f=a;var c=e;return function(a){""!==a&&c("Unexpected "+JSON.stringify(a));return function O(){return O}}}].concat(Array.prototype.slice.call(arguments,1)));for(Array.prototype.forEach.call(c,function(a){d=d(a)});!f;)d=d("");return f}}};l.module$exports&&(l=l.module$exports);var m={module$exports:function(a){return a.replace($,function(a,c){return L[c]})}},L={k:"c",x:"cs",qu:"cw",q:"cw",ph:"f",bh:"v","\u00eb":"e","\u00e2":"\u00e1","\u00ea":"\u00e9","\u00ee":"\u00ed","\u00f4":"\u00f3",
+"\u00fb":"\u00fa"},$=RegExp("("+Object.keys(L).join("|")+")","ig");m.module$exports&&(m=m.module$exports);var n={module$exports:{"-":"comma",",":"comma",":":"comma",";":"full-stop",".":"full-stop","!":"exclamation-point","?":"question-mark","(":"open-paren",")":"close-paren",">":"flourish-left","<":"flourish-right"}};n.module$exports&&(n=n.module$exports);var w={encode:function(a){return a.map(function(a){return a.map(function(a){return a.map(function(a){return a.map(function(a){return a.map(function(a){var c=
+[];a.above&&c.push(a.above);a.below&&c.push(a.below);a.following&&c.push(a.following);a.tildeAbove&&c.push("tilde-above");a.tildeBelow&&c.push("tilde-below");return c.length?a.tengwa+":"+c.join(","):a.tengwa}).join(";")}).join(" ")}).join("\n")}).join("\n\n")}).join("\n\n\n")},decode:function(a,e){return a.split("\n\n\n").map(function(a){return a.split("\n\n").map(function(a){return a.split("\n").map(function(a){return a.split(" ").map(function(a){return y(a,e)})})})})}};w.decodeWord=y;var o={},N=
+j,B=w,P=m,C=n,M={};o.transcribe=function(a,e){e=r(e);return e.font.transcribe(s(a,e))};o.encode=function(a,e){e=r(e);return B.encode(s(a,e))};o.parse=s;var A={iant:"yanta;tinco:a,tilde-above",iaur:"yanta;vala:a;ore",baranduiniant:"umbar;romen:a;ando:a,tilde-above;anna:u;yanta;anto:a,tilde-above",ioreth:"yanta;romen:o;thule:e",noldo:"nwalme;lambe:o;ando;short-carrier:o",noldor:"nwalme;lambe:o;ando;ore:o",is:"short-carrier:i,s"},Q=l(function(a,e){return D(a,e,[])}),t="aeiou\u00f3\u00fa",p={"\u00e1":"a",
+"\u00e9":"e","\u00ed":"i","\u00f3":"o","\u00fa":"u"};o.parseTengwaAnnotations=k;var S=["tinco","parma","short-carrier","lambe"],q={},U=j,W=m,F=n,T={};q.transcribe=function(a,e){e=u(e);return e.font.transcribe(v(a,e))};q.encode=function(a,e){e=u(e);return w.encode(v(a,e))};q.parse=v;var V=l(function(a,e){return G(a,e,[])}),I="aeiouy\u00e1\u00e9\u00ed\u00f3\u00fa",Y=o,Z=q,X=j,K=Array.prototype;document.querySelectorAll&&K.forEach&&("complete"===document.readyState?J():document.addEventListener("DOMContentLoaded",
+J,!0))})();