@dmthepm/commune 0.5.1 → 0.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@dmthepm/commune",
3
3
  "type": "module",
4
- "version": "0.5.1",
4
+ "version": "0.5.2",
5
5
  "description": "An Astro wiki engine with WikiLinks, sliding panes, backlinks and static search, plus a commune CLI that queries the content graph and checks links",
6
6
  "license": "MIT",
7
7
  "keywords": [
@@ -34,15 +34,16 @@
34
34
  if (note?.isStarred) {
35
35
  // Check if star isn't already there
36
36
  if (!link.querySelector('.star-indicator-inline') && !link.nextElementSibling?.classList?.contains('star-indicator-inline')) {
37
- // Create wrapper to prevent line break between link and star
37
+ // The star must not land on a line of its own, but the link itself
38
+ // has to wrap like any other run of text: a whole-link nowrap
39
+ // pushed long titles onto their own line on phones. A no-break
40
+ // space glues the star to the link's last word and nothing else.
38
41
  const wrapper = document.createElement('span');
39
- wrapper.style.whiteSpace = 'nowrap';
40
- wrapper.style.display = 'inline';
41
42
 
42
43
  // Create star as a separate clickable element (not part of the link)
43
44
  const star = document.createElement('span');
44
45
  star.className = 'star-indicator-inline';
45
- star.textContent = ' ⭐';
46
+ star.textContent = '\u00A0⭐';
46
47
  star.setAttribute('aria-label', 'Top 5% most linked - click to learn more');
47
48
  star.setAttribute('role', 'button');
48
49
  star.setAttribute('tabindex', '0');
@@ -67,7 +68,7 @@
67
68
  }
68
69
  });
69
70
 
70
- // Wrap the link in the nowrap container
71
+ // Keep the link and its star as one span
71
72
  link.parentNode.insertBefore(wrapper, link);
72
73
  wrapper.appendChild(link);
73
74
  wrapper.appendChild(star);