on master help sign in
Always switch out Text elements
ef2b38fEvan Czaplicki
libraries/Native/Text.js+1−1
@@ -96,7 +96,7 @@ Elm.Native.Text.make = function(elm) {
96 var raw = {
96 var raw = {
97 ctor:'RawHtml',
97 ctor:'RawHtml',
98 html: '<span style="text-align:' + align + ';">' + text + '</span>',
98 html: '<span style="text-align:' + align + ';">' + text + '</span>',
99− guid: '0',
99+ guid: null,
100 args: [],
100 args: [],
101 };
101 };
102 var pos = A2(Utils.htmlHeight, 0, raw);
102 var pos = A2(Utils.htmlHeight, 0, raw);
runtime/Render/Element.js+6−1
@@ -205,6 +205,11 @@ function update(node, curr, next) {
205 switch(nextE.ctor) {
205 switch(nextE.ctor) {
206 case "Spacer": break;
206 case "Spacer": break;
207 case "RawHtml":
207 case "RawHtml":
208+ // only markdown blocks have guids, so this must be a text block
209+ if (nextE.guid === null) {
210+ node.innerHTML = nextE.html;
211+ break;
212+ }
208 if (nextE.guid !== currE.guid) {
213 if (nextE.guid !== currE.guid) {
209 node.parentNode.replaceChild(render(next),node);
214 node.parentNode.replaceChild(render(next),node);
210 return true;
215 return true;
@@ -267,7 +272,7 @@ function update(node, curr, next) {
267 }
272 }
268 break;
273 break;
269 case "Container":
274 case "Container":
270− update(node.firstChild, currE._1, nextE._1)
275+ update(node.firstChild, currE._1, nextE._1);
271 setPos(nextE._0, nextE._1.props.width, nextE._1.props.height, node.firstChild);
276 setPos(nextE._0, nextE._1.props.width, nextE._1.props.height, node.firstChild);
272 break;
277 break;
273 case "Custom":
278 case "Custom":