svghmi/svghmi.js
changeset 3524 27d298c6f961
parent 3514 f86ffe291fea
child 3535 770fcb344f50
equal deleted inserted replaced
3523:13282f91e6ff 3524:27d298c6f961
   227 
   227 
   228 function svg_text_to_multiline(elt) {
   228 function svg_text_to_multiline(elt) {
   229     return(Array.prototype.map.call(elt.children, x=>x.textContent).join("\\\\n")); 
   229     return(Array.prototype.map.call(elt.children, x=>x.textContent).join("\\\\n")); 
   230 }
   230 }
   231 
   231 
   232 function multiline_to_svg_text(elt, str) {
   232 function multiline_to_svg_text(elt, str, blank) {
   233     str.split('\\\\n').map((line,i) => {elt.children[i].textContent = line;});
   233     str.split('\\\\n').map((line,i) => {elt.children[i].textContent = blank?"":line;});
   234 }
   234 }
   235 
   235 
   236 function switch_langnum(langnum) {
   236 function switch_langnum(langnum) {
   237     langnum = Math.max(0, Math.min(langs.length - 1, langnum));
   237     langnum = Math.max(0, Math.min(langs.length - 1, langnum));
   238 
   238