Project

Profile

Help

Bug #6310

closed

Interactive Saxon doc: Coming from search, code samples render with spaces missing

Added by A Galtman 4 months ago. Updated 4 months ago.

Status:
Closed
Priority:
Low
Category:
Documentation
Sprint/Milestone:
-
Start date:
2024-01-02
Due date:
% Done:

100%

Estimated time:
Legacy ID:
Applies to branch:
12, trunk
Fix Committed on Branch:
12, trunk
Fixed in Maintenance Release:
Platforms:

Description

In Saxon documentation, code blocks are not being rendered as expected when I reach the page from a list of search results.

I'm attaching two screen captures (from Firefox 121.0 on Windows, though I see the same issue in Edge 120.0.2210.91 on Windows, too).

Reproduction steps:

  1. Start from https://www.saxonica.com/documentation12/index.html
  2. Enter saxon:as in the search field and click the magnifying glass
  3. Scroll through the search results and click the result for "saxon:as"
  4. Notice that the page has three code blocks that have horizontal scroll bars and are missing spaces in key places, such as between one attribute value and an adjacent attribute name.
  5. Copy the URL from the browser's address bar ( https://www.saxonica.com/documentation12/index.html#!extensions/attributes/as ) and paste it into a new browser tab. The rendering looks as expected. Another way to make the rendering look as expected is to reload the page in the original tab (which makes the set of search results go away).

These steps use a particular documentation page, but I see the same effect on other pages with code blocks.


Files

unexpected-rendering-from-search-firefox.png (175 KB) unexpected-rendering-from-search-firefox.png Code blocks in right pane exhibit the issue A Galtman, 2024-01-02 15:04
expected-rendering-in-new-tab-firefox.png (156 KB) expected-rendering-in-new-tab-firefox.png Code blocks look normal A Galtman, 2024-01-02 15:04
Actions #1

Updated by Debbie Lockett 4 months ago

  • Category set to Documentation
  • Assignee set to Debbie Lockett
  • Applies to branch 12, trunk added

Thanks for letting us know, and the clear report!

I updated the Saxon 12 interactive documentation with the 12.4 release (2023-11-29) to use syntax highlighting for code samples with Prism. But it looks like it isn't working as expected after a search. I'll look at getting it fixed.

Actions #2

Updated by Debbie Lockett 4 months ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100
  • Fix Committed on Branch 12, trunk added

Fix committed on saxon12 and main branches (for both the main Saxon 12 doc interactive app, and the SaxonC 12 docs):

Fix in the documentation app stylesheet findtext.xsl so that no attempt is made to highlight the search term in sample code (i.e. content of pre elements). (The page content is updated to highlight the search term with the "highlight-text" mode.) This fixes the problem with losing formatting (with spaces) in sample code.

Unfortunately, now if the search term is found in sample code in the page, it will not be highlighted, since this does not work nicely with the syntax highlighting with Prism. I think we're just going to have to live with that. The example provided by Amanda demonstrates why doing better is hard - "saxon:as" in the sample code becomes mixed content in the Prism markup, and handling that will become messy.

Committed rebuilt app SEFs to the www-saxonica-com repo, to fix the online docs.

Please register to edit this issue

Also available in: Atom PDF