« get me outta code hell

hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/content/dependencies/linkContribution.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/content/dependencies/linkContribution.js')
-rw-r--r--src/content/dependencies/linkContribution.js17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/content/dependencies/linkContribution.js b/src/content/dependencies/linkContribution.js
index aa9bdef9..f9c27724 100644
--- a/src/content/dependencies/linkContribution.js
+++ b/src/content/dependencies/linkContribution.js
@@ -11,7 +11,8 @@ export default {
   }),
 
   data: (contribution) => ({
-    annotation: contribution.annotation,
+    artistText: contribution.artistText,
+    annotationParts: contribution.annotationParts,
     urls: contribution.artist.urls,
   }),
 
@@ -22,8 +23,6 @@ export default {
     showExternalLinks: {type: 'boolean', default: false},
     showChronology: {type: 'boolean', default: false},
 
-    trimAnnotation: {type: 'boolean', default: false},
-
     preventWrapping: {type: 'boolean', default: false},
     preventTooltip: {type: 'boolean', default: false},
 
@@ -53,6 +52,12 @@ export default {
           chronologyKind: slots.chronologyKind,
         });
 
+        if (data.artistText) {
+          relations.artistLink.setSlots({
+            content: language.sanitize(data.artistText),
+          });
+        }
+
         workingOptions.artist =
           (html.isBlank(relations.tooltip) || slots.preventTooltip
             ? relations.artistLink
@@ -69,11 +74,9 @@ export default {
               }));
 
         const annotation =
-          (slots.trimAnnotation
-            ? data.annotation?.replace(/^edits for wiki(: )?/, '')
-            : data.annotation);
+          language.formatUnitList(data.annotationParts);
 
-        if (slots.showAnnotation && annotation) {
+        if (slots.showAnnotation && !html.isBlank(annotation)) {
           workingCapsule += '.withContribution';
           workingOptions.contrib = annotation;
         }