Skip to content
Open
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
5 changes: 4 additions & 1 deletion src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ export const ENTRY_POINT_ELEMENTS = [
'.post',
'.markdown-body',
'article',
'[role="article"]',
// HighWire full-text root (bioRxiv, medRxiv, and other HighWire journals).
// Same slot as [role="article"]: below `article`, above `main`. A new
// slot would raise every earlier selector by 40 points over `main`.
'[role="article"], .fulltext-view',
'main',
'[role="main"]',
'.article-body',
Expand Down
7 changes: 7 additions & 0 deletions src/removals/hidden.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@ export function removeHiddenElements(doc: Document, debug: boolean, debugRemoval
continue;
}

// HighWire keeps the inactive full-text view (and each section inside
// it) at display:none until that view is selected. The browser clipper
// would delete the subtree; preserve the node and its descendants.
if (element.closest('.fulltext-view')) {
continue;
}

// Check inline style for hidden patterns
const style = element.getAttribute('style');
if (style && hiddenStylePattern.test(style)) {
Expand Down
20 changes: 20 additions & 0 deletions tests/expected/issues--257-biorxiv-fulltext-view.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
```json
{
"title": "Placeholder Sediment Study",
"author": "",
"site": "example.org",
"published": ""
}
```

## Introduction

INTROCANARY The laboratory tray holds a measured layer of clean sand above a still water column. Each trial starts when a gate opens and lets the grains fall as a single pulse. Observers record the time until the water clears and the depth of the layer that remains on the tray floor. The setup uses the same tray, the same water depth, and the same release height for every trial so the comparison stays fair. A second series repeats the pulse after the sand has been rinsed and dried, which removes dust that would otherwise cloud the water.

The notes also list the room temperature, the mass poured in each pulse, and the number of trials kept after a spill. Nothing in this section restates the short card above. The purpose is to show how the grains move once the gate opens and before any tally is drawn.

## Results

RESULTSCANARY Across the kept trials the water cleared in a narrow band of times, and the layer on the tray floor grew in step with the poured mass. The rinsed sand left a thinner haze than the first series, so the floor mark was easier to read. A heavier pulse did not change the order of settling. Larger grains reached the floor first, and finer grains followed after the column calmed. The pattern held when the release height stayed fixed and only the poured mass changed.

The tally is stored with the placeholder record at https://www.example.org/10.0000/example.2026.01.01.000001. Later work can reuse the same tray and the same pulse gate without treating the short card as the full account.
14 changes: 14 additions & 0 deletions tests/expected/issues--257-fulltext-view-teaser.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
```json
{
"title": "Placeholder Field Notes",
"author": "",
"site": "example.org",
"published": ""
}
```

BODYCANARYONE The field notes describe a walk along a marked trail where sample flags show each stop. At the first stop the notes list the soil color, the slope, and the plants growing beside the path. At the second stop the notes list the same three items again so a later reader can compare the two places. The paragraphs outside the inner block are the account that should remain after extraction.

BODYCANARYTWO A third stop sits near a small stream. The notes record the water clarity, the width of the channel, and the stones on the bed. The walk ends at a gate where the flags are collected and the sheet is closed. These sentences stay with the article even when a shorter block inside it offers a preview of the same walk.

TEASERONLY This inner block previews the walk in a few extra sentences so it is long enough to count as real text. It mentions the flags, the stream, and the gate again, but it does not replace the notes written around it. A clip that keeps only this preview would drop the stops recorded in the surrounding paragraphs.
48 changes: 48 additions & 0 deletions tests/fixtures/issues--257-biorxiv-fulltext-view.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<!-- {"url":"https://www.example.org/content/10.0000/example.2026.01.01.000001v1.full"} -->
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Placeholder Sediment Study</title>
</head>
<body>
<article>
<h1>Placeholder Sediment Study</h1>
<p>
ABSTRACTONLY This summary describes a placeholder study of how river grains settle in a laboratory tray.
The card reports the question, the sample size, and the main numerical result without the later sections.
A reader who stops here misses the methods detail and the comparison across trays.
The page still carries that longer text in a separate full text block.
</p>
</article>
<div class="article fulltext-view" style="display:none">
<div style="display:none">
<h2>Introduction</h2>
<p>
INTROCANARY The laboratory tray holds a measured layer of clean sand above a still water column.
Each trial starts when a gate opens and lets the grains fall as a single pulse.
Observers record the time until the water clears and the depth of the layer that remains on the tray floor.
The setup uses the same tray, the same water depth, and the same release height for every trial so the comparison stays fair.
A second series repeats the pulse after the sand has been rinsed and dried, which removes dust that would otherwise cloud the water.
</p>
<p>
The notes also list the room temperature, the mass poured in each pulse, and the number of trials kept after a spill.
Nothing in this section restates the short card above. The purpose is to show how the grains move once the gate opens and before any tally is drawn.
</p>
</div>
<div style="display:none">
<h2>Results</h2>
<p>
RESULTSCANARY Across the kept trials the water cleared in a narrow band of times, and the layer on the tray floor grew in step with the poured mass.
The rinsed sand left a thinner haze than the first series, so the floor mark was easier to read.
A heavier pulse did not change the order of settling. Larger grains reached the floor first, and finer grains followed after the column calmed.
The pattern held when the release height stayed fixed and only the poured mass changed.
</p>
<p>
The tally is stored with the placeholder record at https://www.example.org/10.0000/example.2026.01.01.000001.
Later work can reuse the same tray and the same pulse gate without treating the short card as the full account.
</p>
</div>
</div>
</body>
</html>
31 changes: 31 additions & 0 deletions tests/fixtures/issues--257-fulltext-view-teaser.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<!-- {"url":"https://www.example.org/content/10.0000/example.2026.01.01.000002"} -->
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Placeholder Field Notes</title>
</head>
<body>
<article>
<h1>Placeholder Field Notes</h1>
<p>
BODYCANARYONE The field notes describe a walk along a marked trail where sample flags show each stop.
At the first stop the notes list the soil color, the slope, and the plants growing beside the path.
At the second stop the notes list the same three items again so a later reader can compare the two places.
The paragraphs outside the inner block are the account that should remain after extraction.
</p>
<p>
BODYCANARYTWO A third stop sits near a small stream. The notes record the water clarity, the width of the channel, and the stones on the bed.
The walk ends at a gate where the flags are collected and the sheet is closed.
These sentences stay with the article even when a shorter block inside it offers a preview of the same walk.
</p>
<div class="fulltext-view">
<p>
TEASERONLY This inner block previews the walk in a few extra sentences so it is long enough to count as real text.
It mentions the flags, the stream, and the gate again, but it does not replace the notes written around it.
A clip that keeps only this preview would drop the stops recorded in the surrounding paragraphs.
</p>
</div>
</article>
</body>
</html>
Loading