You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"for o in _all_: _g[o] = partial(ft, o.lower(), void_=o.lower() in voids)"
136
144
]
137
145
},
138
146
{
@@ -346,8 +354,8 @@
346
354
" <body>\n",
347
355
" <div class=\"myclass\">\n",
348
356
"Some text\n",
349
-
" <input name=\"me\"></input>\n",
350
-
" <img src=\"filename\" data=\"1\"></img>\n",
357
+
" <input name=\"me\">\n",
358
+
" <img src=\"filename\" data=\"1\">\n",
351
359
" </div>\n",
352
360
" </body>\n",
353
361
"</html>\n",
@@ -370,7 +378,7 @@
370
378
},
371
379
{
372
380
"cell_type": "code",
373
-
"execution_count": 107,
381
+
"execution_count": null,
374
382
"id": "798ae1d2",
375
383
"metadata": {},
376
384
"outputs": [
@@ -403,13 +411,13 @@
403
411
},
404
412
{
405
413
"cell_type": "code",
406
-
"execution_count": 108,
414
+
"execution_count": null,
407
415
"id": "5f0e91e0",
408
416
"metadata": {},
409
417
"outputs": [],
410
418
"source": [
411
419
"#| export\n",
412
-
"def highlight(s, lang='xml'):\n",
420
+
"def highlight(s, lang='html'):\n",
413
421
"\"Markdown to syntax-highlight `s` in language `lang`\"\n",
414
422
" return f'```{lang}\\n{to_xml(s)}\\n```'"
415
423
]
@@ -444,9 +452,25 @@
444
452
" return _f"
445
453
]
446
454
},
455
+
{
456
+
"cell_type": "code",
457
+
"execution_count": null,
458
+
"id": "204c3900",
459
+
"metadata": {},
460
+
"outputs": [],
461
+
"source": [
462
+
"#|export\n",
463
+
"@patch\n",
464
+
"def __call__(self:FT, *c, **kw):\n",
465
+
" c,kw = _preproc(c,kw)\n",
466
+
" if c: self[1] = self[1]+c\n",
467
+
" if kw: self[2] = {**self[2], **kw}\n",
468
+
" return self"
469
+
]
470
+
},
447
471
{
448
472
"cell_type": "markdown",
449
-
"id": "9786e4d9",
473
+
"id": "32b75e87",
450
474
"metadata": {},
451
475
"source": [
452
476
"You can also reorder the children to come *after* the attrs, if you use this alternative syntax for `FT` where the children are in a second pair of `()` (behind the scenes this is because `FT` implements `__call__` to add children)."
0 commit comments