|
| 1 | +import { renderToStaticMarkup } from "react-dom/server"; |
| 2 | +import IconLoader from "../../components/IconLoader"; |
1 | 3 |
|
2 | 4 | const UNESCAPE_RE = /(?<markdown>\$(?<model_type>[a-z_]+)-(?<model_id>\d+))/g
|
3 | 5 |
|
@@ -45,17 +47,27 @@ function model_link (state) {
|
45 | 47 | if( state.env.models[item_link.groups.model_type][item_link.groups.model_id] ?? null ) {
|
46 | 48 |
|
47 | 49 | const span_o = state.push('span_open', 'span', 1)
|
| 50 | + span_o.attrPush(['class', 'text-inline']) |
48 | 51 |
|
49 | 52 | const anchor_o = state.push('a_open', 'a', 1)
|
50 | 53 | anchor_o.attrPush(['href', state.env.models[item_link.groups.model_type][item_link.groups.model_id].url])
|
51 | 54 |
|
52 | 55 |
|
53 |
| - // const icon_o = state.push('icon_open', 'span', 1) |
| 56 | + const icon_o = state.push('icon_open', 'span', 1) |
| 57 | + icon_o.attrPush([ |
| 58 | + 'class', 'badge-icon' |
| 59 | + ]) |
54 | 60 |
|
55 |
| - // const icon_t = state.push('text', '', 0) |
56 |
| - // icon_t.content = 'icon ' |
| 61 | + const icon_t = state.push('html_inline', '', 0) |
57 | 62 |
|
58 |
| - // const icon_c = state.push('icon_close', 'span', -1) |
| 63 | + icon_t.content = renderToStaticMarkup( |
| 64 | + <IconLoader |
| 65 | + name={String( item_link.groups.model_type ).toLowerCase().replace('kb', 'information')} |
| 66 | + fill="#777" |
| 67 | + /> |
| 68 | + ) |
| 69 | + |
| 70 | + const icon_c = state.push('icon_close', 'span', -1) |
59 | 71 |
|
60 | 72 |
|
61 | 73 | const anchor_t = state.push('text', '', 0)
|
|
0 commit comments