Mercurial Hosting > lang
comparison src/site.js @ 16:f5425a3c1898
add languages
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Wed, 30 Jul 2025 10:38:27 -0600 |
parents | 2d4b3f003ec2 |
children | 99b71a377f2c |
comparison
equal
deleted
inserted
replaced
15:49e9138b5460 | 16:f5425a3c1898 |
---|---|
136 let rts = mdDiv.querySelectorAll('rt'); | 136 let rts = mdDiv.querySelectorAll('rt'); |
137 for( let rt of rts ) { | 137 for( let rt of rts ) { |
138 rt.remove(); | 138 rt.remove(); |
139 } | 139 } |
140 //console.log(mdDiv.textContent); | 140 //console.log(mdDiv.textContent); |
141 text += `\n<p><audio controls preload=none src="/tts.mp3?text=${encodeURIComponent(mdDiv.textContent)}"></p>\n`; | 141 let lang = div.getAttribute('lang'); |
142 text += `\n<p><audio controls preload=none src="/tts.mp3?lang=${lang}&text=${encodeURIComponent(mdDiv.textContent)}"></p>\n`; | |
142 } | 143 } |
143 div.innerHTML = text; | 144 div.innerHTML = text; |
144 div.removeAttribute('markdown'); | 145 div.removeAttribute('markdown'); |
145 } | 146 } |
146 } | 147 } |