Fossil

Check-in [38a47074]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:For Markdown hyperlinks, if the URL begins with "/" then prepend the root of repository. This allows repository-relative hyperlinks.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:38a4707413e3b3b246f2b418b6bbcd3f2d24241f
User & Date: drh 2016-06-10 13:06:17
References
2016-06-21
15:20
Fix problem reported by Carlo Miron on fossil-dev mailing list: [38a47074] broke empty markdown links check-in: 6bbec5fb user: jan.nijtmans tags: trunk
Context
2016-06-10
13:28
Add the "Special Features" subheading in the Markdown documentation. check-in: a6725ea5 user: drh tags: trunk
13:06
For Markdown hyperlinks, if the URL begins with "/" then prepend the root of repository. This allows repository-relative hyperlinks. check-in: 38a47074 user: drh tags: trunk
12:46
Add the --include and --exclude options to the tarball and zip commands and the in= and ex= query parameters to the /tarball and /zip webpages. check-in: ef449a11 user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/markdown_html.c.

353
354
355
356
357
358
359

360





361
362
363
364
365
366
367
static int html_link(
  struct Blob *ob,
  struct Blob *link,
  struct Blob *title,
  struct Blob *content,
  void *opaque
){

  BLOB_APPEND_LITERAL(ob, "<a href=\"");





  html_escape(ob, blob_buffer(link), blob_size(link));
  if( title && blob_size(title)>0 ){
    BLOB_APPEND_LITERAL(ob, "\" title=\"");
    html_escape(ob, blob_buffer(title), blob_size(title));
  }
  BLOB_APPEND_LITERAL(ob, "\">");
  BLOB_APPEND_BLOB(ob, content);







>

>
>
>
>
>







353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
static int html_link(
  struct Blob *ob,
  struct Blob *link,
  struct Blob *title,
  struct Blob *content,
  void *opaque
){
  char *zLink = blob_buffer(link);
  BLOB_APPEND_LITERAL(ob, "<a href=\"");
  if( zLink[0]=='/' ){
    /* For any hyperlink that begins with "/", make it refer to the root
    ** of the Fossil repository */
    blob_append(ob, g.zTop, -1);
  }
  html_escape(ob, blob_buffer(link), blob_size(link));
  if( title && blob_size(title)>0 ){
    BLOB_APPEND_LITERAL(ob, "\" title=\"");
    html_escape(ob, blob_buffer(title), blob_size(title));
  }
  BLOB_APPEND_LITERAL(ob, "\">");
  BLOB_APPEND_BLOB(ob, content);