Skip to content

Commit 85121cd

Browse files
committed
enh(plot): left-align op-nodes; allways add TARGET attr ...
or else, tooltips don't work without HREF.
1 parent 798909a commit 85121cd

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

graphtik/plot.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ def _drop_gt_lt(x):
295295

296296

297297
def _escape_or_none(context: jinja2.environment.EvalContext, x, escaper):
298-
"""Do not markup Nones/empties, not to break `xmlattr` filter."""
298+
"""Do not markup Nones/empties, so `xmlattr` filter does not include them."""
299299
return x and jinja2.Markup(escaper(str(x)))
300300

301301

@@ -412,11 +412,11 @@ class Style:
412412
'COLOR': color | ee,
413413
'BGCOLOR': fillcolor | ee
414414
} | xmlattr }}
415-
><TR><TD BORDER="1" SIDES="b"
415+
><TR><TD BORDER="1" SIDES="b" ALIGN="left"
416416
{{- {
417417
'TOOLTIP': op_tooltip | truncate | eee,
418418
'HREF': op_url | hrefer | ee,
419-
'TARGET': op_link_target | ee
419+
'TARGET': op_link_target | e
420420
} | xmlattr }}
421421
>
422422
{%- if fontcolor -%}
@@ -429,10 +429,10 @@ class Style:
429429
</TD></TR
430430
>
431431
{%- if fn_name -%}
432-
<TR><TD {{- {
432+
<TR><TD ALIGN="left" {{- {
433433
'TOOLTIP': fn_tooltip | truncate | eee,
434434
'HREF': fn_url | hrefer | ee,
435-
'TARGET': fn_link_target | ee
435+
'TARGET': fn_link_target | e
436436
} | xmlattr }}
437437
>
438438
{%- if fontcolor -%}

0 commit comments

Comments
 (0)