Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Additional phenogrid fixes #943

Merged
merged 2 commits into from
Jan 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion frontend/src/components/AppNodeText.vue
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const props = withDefaults(defineProps<Props>(), {

const container = ref<HTMLSpanElement | SVGTSpanElement | null>(null);

type ReplacedTag = "sup" | "a" | "i";
type ReplacedTag = "sup" | "a" | "i" | "b";

type Replacement = {
type: ReplacedTag;
Expand Down Expand Up @@ -129,6 +129,21 @@ const replacementTags = new Map([
},
},
],
[
"b" as ReplacedTag,
{
regex: /(<b>).*?(<\/b>)/dg,
createSurroundingEl(isSvg: Boolean) {
return isSvg
? document.createElementNS("http://www.w3.org/2000/svg", "tspan")
: document.createElement("b");
},
afterMount(isSvg: Boolean, el: Element) {
if (!isSvg) return;
el.classList.add("svg-bold");
},
},
],
]);

function buildDOM(containerEl: Element) {
Expand Down Expand Up @@ -225,4 +240,7 @@ onUpdated(() => {
.svg-italic {
font-style: italic;
}
.svg-bold {
font-weight: bold;
}
</style>
4 changes: 2 additions & 2 deletions frontend/src/components/ThePhenogrid.vue
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
>
<tooltip
v-for="(col, colIndex) in cols"
:key="colIndex"
:key="col.id"
:interactive="true"
placement="bottom"
follow-cursor="initial"
Expand Down Expand Up @@ -103,7 +103,7 @@
>
<tooltip
v-for="(row, rowIndex) in rows"
:key="rowIndex"
:key="row.id"
:interactive="true"
placement="bottom"
follow-cursor="initial"
Expand Down
Loading