Skip to content

fix(confluence): drop scripts, styles, and unresolved Jira placeholders from indexed page text - #7831

Merged
waleedlatif1 merged 1 commit into
stagingfrom
fix/confluence-embedded-content
Sep 14, 2026
Merged

waleedlatif1 merged 1 commit into
stagingfrom
fix/confluence-embedded-content

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

  • Confluence rendered page bodies now drop <script>/<style> before text extraction. App macros (draw.io, table filter, Markdown) emit a Connect bootstrap script and colored text / table of contents / roadmap emit inline CSS, which were being indexed as page text
  • Unresolved Jira issue macros collapse to their issue key. The REST view body only carries the browser placeholder (KEY - Getting issue details... STATUS, localized), detected by the issue-placeholder class; macros Confluence resolved keep their summary and status
  • Jira issues-table placeholder shells (header row, loading spinner, refresh settings) are dropped; tables with real rows are untouched
  • Callout labeling is unchanged — the view path now runs one cheerio pass (confluenceViewToPlainText) instead of re-serializing and stripping twice
  • Hydrated page metadata no longer overwrites the listing's spaceKey/contentType with undefined, and getDocument reports page vs blogpost from the endpoint that answered
  • Bumps the view representation marker (view-calloutsview-text-v2) so existing non-scoped Confluence documents rehydrate once with the cleaned text; a page whose only content is an app macro now skips as having no extractable text instead of indexing its bootstrap JS

Type of Change

  • Bug fix

Testing

  • Captured live Confluence Cloud v2 body-format=view bodies from 502 public pages across 18 sites and diffed old vs new output: callout labels identical on every page; every removed segment is CSS, Connect bootstrap JS, Jira issue placeholder text, or a Jira table placeholder shell; no text added and every Jira key preserved
  • Confirmed export_view returns no Jira summary/status either, so reading a different body format would not recover more
  • New unit tests built from real markup (localized placeholder, resolved macro, table shell vs real table, macro inside a callout, word boundary around a dropped style, endpoint content type / metadata); each fails with its fix reverted
  • Confluence + connector sync suites, lint, type-check, check:audits, docs manifest check

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel

vercel Bot commented Sep 14, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
docs Skipped Skipped Sep 14, 2026 11:41pm UTC

Request Review

@greptile-apps

greptile-apps Bot commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

The PR appears safe to merge; no concrete correctness, security, or repository-rule violations remain.

Summary

This PR consolidates rendered Confluence body cleanup into one text-extraction pass and improves hydrated metadata accuracy.

  • Removes scripts, styles, unresolved Jira placeholder prose, and Jira loading-table shells from indexed text.
  • Preserves resolved Jira details and existing callout labels.
  • Retains listing metadata when hydrated fields are absent and records the content type of the endpoint that resolved the document.
  • Advances the rendered-content representation marker so existing documents receive the corrected extraction behavior.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  API[Confluence view body] --> Parse[Parse with Cheerio]
  Parse --> Noise[Replace scripts and styles]
  Noise --> Jira[Collapse unresolved Jira placeholders]
  Jira --> Callouts[Rewrite callouts with labels]
  Callouts --> Text[Convert to normalized plain text]
  Text --> Document[Hydrated knowledge document]
Loading

Reviews (1) · Last reviewed commit: "fix(confluence): drop scripts, styles, a..."

@waleedlatif1
waleedlatif1 merged commit 4ef52fd into staging Sep 14, 2026
33 checks passed
@waleedlatif1
waleedlatif1 deleted the fix/confluence-embedded-content branch September 14, 2026 23:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant