Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
cb638a3
feat: add local Safari testing via safaridriver
marcoscaceres Mar 27, 2026
0528e1a
fix(karma.safari): improve robustness of safaridriver launcher
marcoscaceres Mar 28, 2026
ad44001
fix(karma.safari): prevent double _done(failure) on startup error
marcoscaceres Mar 28, 2026
ab9bb8d
fix(karma.safari): reject startup wait on early exit event
marcoscaceres Mar 30, 2026
aca6244
fix(highlight): use textContent instead of innerText for code extraction
marcoscaceres Mar 30, 2026
0cbef16
fix: prettier formatting in karma.safari.cjs
marcoscaceres Apr 8, 2026
8e66e08
fix: address Copilot review feedback
marcoscaceres Apr 13, 2026
bdb1611
feat: add Safari to CI (macos-latest) in pr.yml and push.yml
Copilot Apr 14, 2026
6c23c5f
fix: replace fixed 500ms wait with safaridriver /status polling for C…
Copilot Apr 14, 2026
c9e206e
fix: prettier formatting in karma.safari.cjs
Copilot Apr 14, 2026
bcfd8fb
fix: handle Safari srcdoc iframe SecurityError in postMessage and wai…
Copilot Apr 14, 2026
93dd7cc
fix: use cleanup() in unexpected-exit handler for proper session tear…
Copilot Apr 15, 2026
95a3132
fix: use doc.respec.ready polling as Safari fallback in waitReady
Copilot Apr 15, 2026
a18c0ec
chore: apply prettier formatting to CI workflow files
Copilot Apr 17, 2026
bad2cc6
fix(test): remove ev.source check in Safari msgHandler; normalise cat…
Copilot Apr 19, 2026
b666fdf
fix(core/pubsubhub): skip postMessage when origin unavailable
marcoscaceres Apr 26, 2026
e52d41a
fix(tests): validate SAFARIDRIVER_PORT is numeric
marcoscaceres Apr 27, 2026
5b21beb
fix(pubsubhub): send end-all via postMessage("*") in Safari opaque-or…
Copilot Apr 28, 2026
72fc870
fix(core/issues-notes): validate GitHub label color, use html templat…
marcoscaceres Apr 27, 2026
d5a21e6
fix: make target background of references accessible in dark mode (#5…
marcoscaceres Apr 27, 2026
7c7409a
Merge branch 'main' into chore/safari-launcher
marcoscaceres Apr 29, 2026
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
21 changes: 15 additions & 6 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
echo "::error::Uh oh! builds/ was changed."; exit 1
- uses: pnpm/action-setup@v5
- uses: actions/setup-node@v6
with: { node-version-file: '.nvmrc', cache: pnpm }
with: { node-version-file: ".nvmrc", cache: pnpm }
- run: pnpm i --frozen-lockfile
- run: pnpm lint

Expand All @@ -45,7 +45,7 @@ jobs:
- uses: actions/checkout@v6
- uses: pnpm/action-setup@v5
- uses: actions/setup-node@v6
with: { node-version-file: '.nvmrc', cache: pnpm }
with: { node-version-file: ".nvmrc", cache: pnpm }
- run: pnpm i --frozen-lockfile
- run: pnpm test:build
- run: pnpm build:w3c
Expand All @@ -55,14 +55,23 @@ jobs:
name: Karma Unit Tests (${{ matrix.browser }})
strategy:
matrix:
browser: [ChromeHeadless, FirefoxHeadless]
runs-on: ubuntu-latest
include:
- browser: ChromeHeadless
os: ubuntu-latest
- browser: FirefoxHeadless
os: ubuntu-latest
- browser: Safari
os: macos-latest
runs-on: ${{ matrix.os }}
needs: lint
steps:
- uses: actions/checkout@v6
- uses: pnpm/action-setup@v5
- uses: actions/setup-node@v6
with: { node-version-file: '.nvmrc', cache: pnpm }
with: { node-version-file: ".nvmrc", cache: pnpm }
- name: Enable Safari WebDriver
if: matrix.browser == 'Safari'
run: sudo safaridriver --enable
- run: pnpm i --frozen-lockfile
- run: pnpm build:w3c & pnpm build:geonovum
- run: pnpm test:unit
Expand All @@ -80,7 +89,7 @@ jobs:
- uses: actions/checkout@v6
- uses: pnpm/action-setup@v5
- uses: actions/setup-node@v6
with: { node-version-file: '.nvmrc', cache: pnpm }
with: { node-version-file: ".nvmrc", cache: pnpm }
- run: pnpm i --frozen-lockfile
- run: pnpm build:w3c
- name: run validator
Expand Down
22 changes: 20 additions & 2 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
- uses: actions/checkout@v6
- uses: pnpm/action-setup@v5
- uses: actions/setup-node@v6
with: { node-version-file: '.nvmrc', cache: pnpm }
with: { node-version-file: ".nvmrc", cache: pnpm }
- run: pnpm i --frozen-lockfile
- run: pnpm build:w3c
- run: pnpm test:headless
Expand All @@ -55,9 +55,27 @@ jobs:
- uses: actions/checkout@v6
- uses: pnpm/action-setup@v5
- uses: actions/setup-node@v6
with: { node-version-file: '.nvmrc', cache: pnpm }
with: { node-version-file: ".nvmrc", cache: pnpm }
- run: pnpm i --frozen-lockfile
- run: pnpm build:w3c & pnpm build:geonovum
- run: pnpm test
env:
BROWSERS: ChromeHeadless

test-karma-safari:
name: Karma Unit Tests (Safari)
runs-on: macos-latest
steps:
- uses: actions/checkout@v6
- uses: pnpm/action-setup@v5
- uses: actions/setup-node@v6
with: { node-version-file: ".nvmrc", cache: pnpm }
- run: sudo safaridriver --enable
- run: pnpm i --frozen-lockfile
- run: pnpm build:w3c & pnpm build:geonovum
- run: pnpm test:unit
env:
BROWSERS: Safari
- run: pnpm test:integration
env:
BROWSERS: Safari
Comment thread
marcoscaceres marked this conversation as resolved.
2 changes: 1 addition & 1 deletion src/core/highlight.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ async function highlightElement(elem) {
const languages = getLanguageHint(htmlElem.classList);
let response;
try {
response = await sendHighlightRequest(htmlElem.innerText, languages);
response = await sendHighlightRequest(htmlElem.textContent, languages);
} catch (err) {
console.error(err);
return;
Expand Down
11 changes: 6 additions & 5 deletions src/core/markdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,16 +64,17 @@ class Renderer extends marked.Renderer {
}

/**
* @param {string} infoString
* @param {string | undefined} infoString
*/
static parseInfoString(infoString) {
const firstSpace = infoString.search(/\s/);
const str = infoString || "";
const firstSpace = str.search(/\s/);
if (firstSpace === -1) {
return { language: infoString };
return { language: str };
}

const language = infoString.slice(0, firstSpace);
const metaDataStr = infoString.slice(firstSpace + 1);
const language = str.slice(0, firstSpace);
const metaDataStr = str.slice(firstSpace + 1);
let metaData;
if (metaDataStr) {
try {
Expand Down
18 changes: 17 additions & 1 deletion src/core/pubsubhub.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,23 @@ export function pub(topic, detail) {
}
// If this is an iframe, postMessage parent (used in testing).
const args = String(JSON.stringify(detail?.stack || detail));
window.parent.postMessage({ topic, args }, window.parent.location.origin);
// Safari can throw SecurityError accessing parent.location.origin from
// srcdoc iframes (treated as opaque origin). For the "end-all" signal
// (detail = undefined, no sensitive data) fall back to "*" so the test
// harness receives it. For all other topics skip the postMessage entirely
// to avoid broadcasting potentially sensitive data to unknown origins.
let targetOrigin;
try {
targetOrigin = window.parent.location.origin;
} catch {
if (topic !== "end-all") return;
targetOrigin = "*";
}
try {
window.parent.postMessage({ topic, args }, targetOrigin);
} catch {
Comment thread
marcoscaceres marked this conversation as resolved.
// Ignore: postMessage may throw in restricted browsing contexts.
}
}

/**
Expand Down
2 changes: 1 addition & 1 deletion tests/karma.conf.base.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ module.exports = config => {
require("karma-jasmine-html-reporter"),
require("karma-chrome-launcher"),
require("karma-firefox-launcher"),
require("karma-safari-launcher"),
require("./karma.safari.cjs"),
],
frameworks: ["jasmine"],
files,
Expand Down
Loading
Loading