View Issue Details

IDProjectCategoryView StatusLast Update
0021637LazarusLCLpublic2016-06-30 11:23
ReportercobinesAssigned ToBigChimp 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionnot fixable 
PlatformWin32OSWindows XPOS VersionSP3
Product Version0.9.31 (SVN)Product Build36507 
Target VersionFixed in Version 
Summary0021637: HTML help with keyword containing # does not jump to anchor
DescriptionWhen keyword is "/example.html#jump" it should show "example.html" and jump to "jump" anchor. It doesn't and address displayed in browser also does not include "#jump".

The URL is not cut when using ? and & but it is with #.

In FindDefaultBrowser all other %s parameters are quoted, but not the one to "url.dll,FileProtocolHandler". I think it should be quoted too.

Steps To ReproduceRun example, press F1. It should show "jump to here" but instead shows "This is the top"
Tagspatch
Fixed in Revision
LazTarget-
WidgetsetWin32/Win64
Attached Files
  • help_anchor.zip (2,302 bytes)
  • htmlhelp_anchor.diff (485 bytes)
    Index: lcl/include/sysenvapis.inc
    ===================================================================
    --- lcl/include/sysenvapis.inc	(revision 36507)
    +++ lcl/include/sysenvapis.inc	(working copy)
    @@ -14,7 +14,7 @@
     begin
       {$IFDEF MSWindows}
       Find('rundll32', ABrowser);
    -  AParams := 'url.dll,FileProtocolHandler %s';
    +  AParams := 'url.dll,FileProtocolHandler "%s"';
       {$ELSE}
         {$IFDEF DARWIN}
         // open command launches url in the appropriate browser under Mac OS X
    
    htmlhelp_anchor.diff (485 bytes)

Relationships

has duplicate 0030326 closedBart Broersma OpenUrl on local html does not use the anchor 
related to 0026091 resolvedBart Broersma LCLIntf openurl() / LazHelpHTML - HtmlBrowserHelpViewer can not pass query string or anchor target 

Activities

2012-04-03 07:10

 

help_anchor.zip (2,302 bytes)

2012-04-03 07:11

 

htmlhelp_anchor.diff (485 bytes)
Index: lcl/include/sysenvapis.inc
===================================================================
--- lcl/include/sysenvapis.inc	(revision 36507)
+++ lcl/include/sysenvapis.inc	(working copy)
@@ -14,7 +14,7 @@
 begin
   {$IFDEF MSWindows}
   Find('rundll32', ABrowser);
-  AParams := 'url.dll,FileProtocolHandler %s';
+  AParams := 'url.dll,FileProtocolHandler "%s"';
   {$ELSE}
     {$IFDEF DARWIN}
     // open command launches url in the appropriate browser under Mac OS X
htmlhelp_anchor.diff (485 bytes)

cobines

2012-04-03 07:13

reporter   ~0058271

By they way "sysenvapis.inc" is not included in LCL package so changes don't cause recompile.

Juha Manninen

2014-10-24 12:13

developer   ~0078577

Is this still valid? There is a patch.

Reinier Olislagers

2014-10-24 16:41

developer   ~0078596

Last edited: 2014-10-26 13:50

View 8 revisions

Patch has no effect on Win7, lax trunk, fpc trunk: html opens, but not at anchor.
Edit: working on this...

Manual testing does not work either:
rundll32 url.dll,FileProtocolHandler "file://D:/test/anch/example.html#jump"
(ignore the caret and brackets at the end of the line)

However, for remote urls, small VB.Net program.sln works - no quoting seems necessary there:

Module Program
    Sub Main()
        Console.WriteLine("Testing rundll32 url.dll to open web page with anchor")
        Dim StartInfo As New System.Diagnostics.ProcessStartInfo
        ' Should demonstrate anchor i.e. Not top Of page but browser should scroll To anchor
        StartInfo.FileName = "rundll32"
        StartInfo.Arguments = "url.dll,FileProtocolHandler" +
            " " +
            "http://wiki.lazarus.freepascal.org/Main_Page#Downloads"
        Console.WriteLine("Result:")
        Console.WriteLine(System.Diagnostics.Process.Start(StartInfo))
    End Sub
End Module
Plugging in the file-based URL (either quoted with double quotes or not), it does NOT scroll to the anchor.

Summary: I see no fix for this. Going to close this.

Reinier Olislagers

2014-10-26 13:51

developer   ~0078620

BTW, relevant code in \lcl\lazhelphtml in
function THTMLBrowserHelpViewer.ShowNode(Node: THelpNode; var ErrMsg: string
  ): TShowHelpResult;

Reinier Olislagers

2014-10-26 13:52

developer   ~0078621

Unfortunately I cannot fix this: quoting does not work for file:// URLs. If you have a different working solution/patch, please feel free to reopen.

Thank you.

Issue History

Date Modified Username Field Change
2012-04-03 07:10 cobines New Issue
2012-04-03 07:10 cobines File Added: help_anchor.zip
2012-04-03 07:11 cobines File Added: htmlhelp_anchor.diff
2012-04-03 07:13 cobines Note Added: 0058271
2014-10-24 12:12 Juha Manninen Assigned To => Reinier Olislagers
2014-10-24 12:12 Juha Manninen Status new => assigned
2014-10-24 12:12 Juha Manninen Tag Attached: patch
2014-10-24 12:13 Juha Manninen Note Added: 0078577
2014-10-24 16:41 Reinier Olislagers LazTarget => -
2014-10-24 16:41 Reinier Olislagers Note Added: 0078596
2014-10-24 16:41 Reinier Olislagers Status assigned => feedback
2014-10-24 16:42 Reinier Olislagers Note Edited: 0078596 View Revisions
2014-10-24 16:42 Reinier Olislagers Note Edited: 0078596 View Revisions
2014-10-25 12:35 Reinier Olislagers Note Edited: 0078596 View Revisions
2014-10-25 14:12 Reinier Olislagers Status feedback => assigned
2014-10-26 13:32 Reinier Olislagers Note Edited: 0078596 View Revisions
2014-10-26 13:47 Reinier Olislagers Note Edited: 0078596 View Revisions
2014-10-26 13:47 Reinier Olislagers Note Edited: 0078596 View Revisions
2014-10-26 13:50 Reinier Olislagers Note Edited: 0078596 View Revisions
2014-10-26 13:51 Reinier Olislagers Note Added: 0078620
2014-10-26 13:52 Reinier Olislagers Widgetset => Win32/Win64
2014-10-26 13:52 Reinier Olislagers Note Added: 0078621
2014-10-26 13:52 Reinier Olislagers Status assigned => resolved
2014-10-26 13:52 Reinier Olislagers Resolution open => not fixable
2014-10-26 13:59 Reinier Olislagers Relationship added related to 0026091
2016-06-30 11:23 Bart Broersma Relationship added has duplicate 0030326