samengine 1.7.7 → 1.8.1

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.
@@ -1,4 +1,4 @@
1
1
  // Function to get the Version
2
2
  export function version() {
3
- return "1.7.6";
3
+ return "1.7.8";
4
4
  }
@@ -61,6 +61,14 @@ function renderInline(text, opts) {
61
61
  return `\x00HTML${idx}\x00`;
62
62
  });
63
63
  }
64
+ // Links [text](url "title")
65
+ text = text.replace(/\[([^\]]+)\]\(([^)]+?)(?:\s+"([^"]*)")?\)/g, (_, linkText, url, title) => {
66
+ const t = title ? ` title="${escapeHtml(title)}"` : "";
67
+ const ext = opts.externalLinks && isExternalUrl(url)
68
+ ? ' target="_blank" rel="noopener noreferrer"'
69
+ : "";
70
+ return `<a href="${url}"${t}${ext}>${renderInline(linkText, opts)}</a>`;
71
+ });
64
72
  // Code-Spans (höchste Priorität, vor allem anderen)
65
73
  text = text.replace(/`{2}([^`]+)`{2}|`([^`\n]+)`/g, (_, a, b) => {
66
74
  return `<code>${escapeHtml(a ?? b)}</code>`;
@@ -70,14 +78,6 @@ function renderInline(text, opts) {
70
78
  const t = title ? ` title="${escapeHtml(title)}"` : "";
71
79
  return `<img src="${url}" alt="${escapeHtml(alt)}"${t}>`;
72
80
  });
73
- // Links [text](url "title")
74
- text = text.replace(/\[([^\]]+)\]\(([^)]+?)(?:\s+"([^"]*)")?\)/g, (_, linkText, url, title) => {
75
- const t = title ? ` title="${escapeHtml(title)}"` : "";
76
- const ext = opts.externalLinks && isExternalUrl(url)
77
- ? ' target="_blank" rel="noopener noreferrer"'
78
- : "";
79
- return `<a href="${url}"${t}${ext}>${renderInline(linkText, opts)}</a>`;
80
- });
81
81
  // Autolinks <https://…>
82
82
  text = text.replace(/<(https?:\/\/[^\s>]+)>/g, (_, url) => {
83
83
  const ext = opts.externalLinks
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "samengine",
3
- "version": "1.7.7",
3
+ "version": "1.8.1",
4
4
  "description": "A TypeScript game library to make HTML Games",
5
5
  "sideEffects": false,
6
6
  "files": [