Index: auto.def ================================================================== --- auto.def +++ auto.def @@ -11,11 +11,10 @@ internal-sqlite=1 => {Don't use the internal sqlite, use the system one} static=0 => {Link a static executable} lineedit=1 => {Disable line editing} fossil-debug=0 => {Build with fossil debugging enabled} json=0 => {Build with fossil JSON API enabled} - markdown=0 => {Build with markdown engine enabled} } # sqlite wants these types if possible cc-with {-includes {stdint.h inttypes.h}} { cc-check-types uint32_t uint16_t int16_t uint8_t @@ -76,12 +75,11 @@ define-append EXTRA_CFLAGS -DFOSSIL_ENABLE_JSON define FOSSIL_ENABLE_JSON } if {[opt-bool markdown]} { - define-append EXTRA_CFLAGS -DFOSSIL_ENABLE_MARKDOWN - define FOSSIL_ENABLE_MARKDOWN + # no-op. Markdown is now enabled by default. } if {[opt-bool static]} { # XXX: This will not work on all systems. define-append EXTRA_LDFLAGS -static Index: src/checkin.c ================================================================== --- src/checkin.c +++ src/checkin.c @@ -565,13 +565,12 @@ ** parent_rid is the recordid of the parent check-in. */ static void prepare_commit_comment( Blob *pComment, char *zInit, - const char *zBranch, - int parent_rid, - const char *zUserOvrd + CheckinInfo *p, + int parent_rid ){ Blob prompt; #ifdef _WIN32 int bomSize; const unsigned char *bom = get_utf8_bom(&bomSize); @@ -585,13 +584,13 @@ blob_append(&prompt, "\n" "# Enter comments on this check-in. Lines beginning with # are ignored.\n" "#\n", -1 ); - blob_appendf(&prompt, "# user: %s\n", zUserOvrd ? zUserOvrd : g.zLogin); - if( zBranch && zBranch[0] ){ - blob_appendf(&prompt, "# tags: %s\n#\n", zBranch); + blob_appendf(&prompt, "# user: %s\n", p->zUserOvrd ? p->zUserOvrd : g.zLogin); + if( p->zBranch && p->zBranch[0] ){ + blob_appendf(&prompt, "# tags: %s\n#\n", p->zBranch); }else{ char *zTags = info_tags_of_checkin(parent_rid, 1); if( zTags ) blob_appendf(&prompt, "# tags: %z\n#\n", zTags); } status_report(&prompt, "# ", 1, 0); @@ -706,28 +705,39 @@ for(i=2; i %s\n", g.argv[i], date_in_standard_format(g.argv[i])); } } +#if INTERFACE +/* +** The following structure holds some of the information needed to construct a +** check-in manifest. +*/ +struct CheckinInfo { + Blob *pComment; /* Check-in comment text */ + const char *zMimetype; /* Mimetype of check-in command. May be NULL */ + int verifyDate; /* Verify that child is younger */ + Blob *pCksum; /* Repository checksum. May be 0 */ + const char *zDateOvrd; /* Date override. If 0 then use 'now' */ + const char *zUserOvrd; /* User override. If 0 then use g.zLogin */ + const char *zBranch; /* Branch name. May be 0 */ + const char *zColor; /* One-time background color. May be 0 */ + const char *zBrClr; /* Persistent branch color. May be 0 */ + const char **azTag; /* Tags to apply to this check-in */ +}; +#endif /* INTERFACE */ + /* ** Create a manifest. */ static void create_manifest( Blob *pOut, /* Write the manifest here */ const char *zBaselineUuid, /* UUID of baseline, or zero */ Manifest *pBaseline, /* Make it a delta manifest if not zero */ - Blob *pComment, /* Check-in comment text */ - int vid, /* blob-id of the parent manifest */ - int verifyDate, /* Verify that child is younger */ - Blob *pCksum, /* Repository checksum. May be 0 */ - const char *zDateOvrd, /* Date override. If 0 then use 'now' */ - const char *zUserOvrd, /* User override. If 0 then use g.zLogin */ - const char *zBranch, /* Branch name. May be 0 */ - const char *zColor, /* One-time background color. May be 0 */ - const char *zBrClr, /* Persistent branch color. May be 0 */ - const char **azTag, /* Tags to apply to this check-in */ - int *pnFBcard /* Number of generated B- and F-cards */ + int vid, /* BLOB.id for the parent check-in */ + CheckinInfo *p, /* Information about the check-in */ + int *pnFBcard /* OUT: Number of generated B- and F-cards */ ){ char *zDate; /* Date of the check-in */ char *zParentUuid; /* UUID of parent check-in */ Blob filename; /* A single filename */ int nBasename; /* Size of base filename */ @@ -735,10 +745,11 @@ Stmt q2; /* Query of merge parents */ Blob mcksum; /* Manifest checksum */ ManifestFile *pFile; /* File from the baseline */ int nFBcard = 0; /* Number of B-cards and F-cards */ int i; /* Loop counter */ + const char *zColor; /* Modified value of p->zColor */ assert( pBaseline==0 || pBaseline->zBaseline==0 ); assert( pBaseline==0 || zBaselineUuid!=0 ); blob_zero(pOut); zParentUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", vid); @@ -748,12 +759,12 @@ pFile = manifest_file_next(pBaseline, 0); nFBcard++; }else{ pFile = 0; } - blob_appendf(pOut, "C %F\n", blob_str(pComment)); - zDate = date_in_standard_format(zDateOvrd ? zDateOvrd : "now"); + blob_appendf(pOut, "C %F\n", blob_str(p->pComment)); + zDate = date_in_standard_format(p->zDateOvrd ? p->zDateOvrd : "now"); blob_appendf(pOut, "D %s\n", zDate); zDate[10] = ' '; db_prepare(&q, "SELECT pathname, uuid, origname, blob.rid, isexe, islink," " is_selected(vfile.id)" @@ -827,67 +838,72 @@ while( pFile ){ blob_appendf(pOut, "F %F\n", pFile->zName); pFile = manifest_file_next(pBaseline, 0); nFBcard++; } + if( p->zMimetype && p->zMimetype[0] ){ + blob_appendf(pOut, "N %F\n", p->zMimetype); + } blob_appendf(pOut, "P %s", zParentUuid); - if( verifyDate ) checkin_verify_younger(vid, zParentUuid, zDate); + if( p->verifyDate ) checkin_verify_younger(vid, zParentUuid, zDate); free(zParentUuid); db_prepare(&q2, "SELECT merge FROM vmerge WHERE id=0"); while( db_step(&q2)==SQLITE_ROW ){ char *zMergeUuid; int mid = db_column_int(&q2, 0); if( !g.markPrivate && content_is_private(mid) ) continue; zMergeUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", mid); if( zMergeUuid ){ blob_appendf(pOut, " %s", zMergeUuid); - if( verifyDate ) checkin_verify_younger(mid, zMergeUuid, zDate); + if( p->verifyDate ) checkin_verify_younger(mid, zMergeUuid, zDate); free(zMergeUuid); } } db_finalize(&q2); free(zDate); blob_appendf(pOut, "\n"); - if( pCksum ) blob_appendf(pOut, "R %b\n", pCksum); - if( zBranch && zBranch[0] ){ + if( p->pCksum ) blob_appendf(pOut, "R %b\n", p->pCksum); + zColor = p->zColor; + if( p->zBranch && p->zBranch[0] ){ /* Set tags for the new branch */ - if( zBrClr && zBrClr[0] ){ + if( p->zBrClr && p->zBrClr[0] ){ zColor = 0; - blob_appendf(pOut, "T *bgcolor * %F\n", zBrClr); + blob_appendf(pOut, "T *bgcolor * %F\n", p->zBrClr); } - blob_appendf(pOut, "T *branch * %F\n", zBranch); - blob_appendf(pOut, "T *sym-%F *\n", zBranch); + blob_appendf(pOut, "T *branch * %F\n", p->zBranch); + blob_appendf(pOut, "T *sym-%F *\n", p->zBranch); } if( zColor && zColor[0] ){ /* One-time background color */ blob_appendf(pOut, "T +bgcolor * %F\n", zColor); } - if( azTag ){ - for(i=0; azTag[i]; i++){ + if( p->azTag ){ + for(i=0; p->azTag[i]; i++){ /* Add a symbolic tag to this check-in. The tag names have already ** been sorted and converted using the %F format */ - blob_appendf(pOut, "T +sym-%s *\n", azTag[i]); + assert( i==0 || strcmp(p->azTag[i-1], p->azTag[i])<=0 ); + blob_appendf(pOut, "T +sym-%s *\n", p->azTag[i]); } } - if( zBranch && zBranch[0] ){ + if( p->zBranch && p->zBranch[0] ){ /* For a new branch, cancel all prior propagating tags */ Stmt q; db_prepare(&q, "SELECT tagname FROM tagxref, tag" " WHERE tagxref.rid=%d AND tagxref.tagid=tag.tagid" " AND tagtype==2 AND tagname GLOB 'sym-*'" " AND tagname!='sym-'||%Q" " ORDER BY tagname", - vid, zBranch); + vid, p->zBranch); while( db_step(&q)==SQLITE_ROW ){ const char *zBrTag = db_column_text(&q, 0); blob_appendf(pOut, "T -%F *\n", zBrTag); } db_finalize(&q); } - blob_appendf(pOut, "U %F\n", zUserOvrd ? zUserOvrd : g.zLogin); + blob_appendf(pOut, "U %F\n", p->zUserOvrd ? p->zUserOvrd : g.zLogin); md5sum_blob(pOut, &mcksum); blob_appendf(pOut, "Z %b\n", &mcksum); if( pnFBcard ) *pnFBcard = nFBcard; } @@ -1092,10 +1108,11 @@ ** --branch NEW-BRANCH-NAME check in to this new branch ** --branchcolor COLOR apply given COLOR to the branch ** --comment|-m COMMENT-TEXT use COMMENT-TEXT as commit comment ** --delta use a delta manifest in the commit process ** --message-file|-M FILE read the commit comment from given file +** --mimetype MIMETYPE mimetype of check-in comment ** --no-warnings omit all warnings about file contents ** --nosign do not attempt to sign this commit with gpg ** --private do not sync changes and their descendants ** --tag TAG-NAME assign given tag TAG-NAME to the checkin ** @@ -1122,15 +1139,11 @@ int allowOlder = 0; /* Allow a commit older than its ancestor */ char *zManifestFile; /* Name of the manifest file */ int useCksum; /* True if checksums should be computed and verified */ int outputManifest; /* True to output "manifest" and "manifest.uuid" */ int testRun; /* True for a test run. Debugging only */ - const char *zBranch; /* Create a new branch with this name */ - const char *zBrClr; /* Set background color when branching */ - const char *zColor; /* One-time check-in color */ - const char *zDateOvrd; /* Override date string */ - const char *zUserOvrd; /* Override user name */ + CheckinInfo sCiInfo; /* Information about this check-in */ const char *zComFile; /* Read commit message from this file */ int nTag = 0; /* Number of --tag arguments */ const char *zTag; /* A single --tag argument */ const char **azTag = 0;/* Array of all --tag arguments */ Blob manifest; /* Manifest in baseline form */ @@ -1142,10 +1155,11 @@ int nConflict = 0; /* Number of unresolved merge conflicts */ int abortCommit = 0; Blob ans; char cReply; + memset(&sCiInfo, 0, sizeof(sCiInfo)); url_proxy_options(); noSign = find_option("nosign",0,0)!=0; forceDelta = find_option("delta",0,0)!=0; forceBaseline = find_option("baseline",0,0)!=0; if( forceDelta && forceBaseline ){ @@ -1157,27 +1171,30 @@ allowConflict = find_option("allow-conflict",0,0)!=0; allowEmpty = find_option("allow-empty",0,0)!=0; allowFork = find_option("allow-fork",0,0)!=0; allowOlder = find_option("allow-older",0,0)!=0; noWarningFlag = find_option("no-warnings", 0, 0)!=0; - zBranch = find_option("branch","b",1); - zColor = find_option("bgcolor",0,1); - zBrClr = find_option("branchcolor",0,1); + sCiInfo.zBranch = find_option("branch","b",1); + sCiInfo.zColor = find_option("bgcolor",0,1); + sCiInfo.zBrClr = find_option("branchcolor",0,1); + sCiInfo.zMimetype = find_option("mimetype",0,1); while( (zTag = find_option("tag",0,1))!=0 ){ if( zTag[0]==0 ) continue; - azTag = fossil_realloc((void *)azTag, sizeof(char*)*(nTag+2)); - azTag[nTag++] = zTag; - azTag[nTag] = 0; + sCiInfo.azTag = fossil_realloc((void*)sCiInfo.azTag, sizeof(char*)*(nTag+2)); + sCiInfo.azTag[nTag++] = zTag; + sCiInfo.azTag[nTag] = 0; } zComFile = find_option("message-file", "M", 1); if( find_option("private",0,0) ){ g.markPrivate = 1; - if( zBranch==0 ) zBranch = "private"; - if( zBrClr==0 && zColor==0 ) zBrClr = "#fec084"; /* Orange */ + if( sCiInfo.zBranch==0 ) sCiInfo.zBranch = "private"; + if( sCiInfo.zBrClr==0 && sCiInfo.zColor==0 ){ + sCiInfo.zBrClr = "#fec084"; /* Orange */ + } } - zDateOvrd = find_option("date-override",0,1); - zUserOvrd = find_option("user-override",0,1); + sCiInfo.zDateOvrd = find_option("date-override",0,1); + sCiInfo.zUserOvrd = find_option("user-override",0,1); db_must_be_within_tree(); noSign = db_get_boolean("omitsign", 0)|noSign; if( db_get_boolean("clearsign", 0)==0 ){ noSign = 1; } useCksum = db_get_boolean("repo-cksum", 1); outputManifest = db_get_boolean("manifest", 0); @@ -1309,11 +1326,11 @@ /* ** Do not allow a commit that will cause a fork unless the --allow-fork ** or --force flags is used, or unless this is a private check-in. */ - if( zBranch==0 && allowFork==0 && forceFlag==0 + if( sCiInfo.zBranch==0 && allowFork==0 && forceFlag==0 && g.markPrivate==0 && !is_a_leaf(vid) ){ fossil_fatal("would fork. \"update\" first or use --allow-fork."); } @@ -1334,11 +1351,11 @@ blob_zero(&comment); blob_read_from_file(&comment, zComFile); blob_to_utf8_no_bom(&comment, 1); }else{ char *zInit = db_text(0, "SELECT value FROM vvar WHERE name='ci-comment'"); - prepare_commit_comment(&comment, zInit, zBranch, vid, zUserOvrd); + prepare_commit_comment(&comment, zInit, &sCiInfo, vid); if( zInit && zInit[0] && fossil_strcmp(zInit, blob_str(&comment))==0 ){ blob_zero(&ans); prompt_user("unchanged check-in comment. continue (y/N)? ", &ans); cReply = blob_str(&ans)[0]; if( cReply!='y' && cReply!='Y' ) fossil_exit(1);; @@ -1424,17 +1441,21 @@ /* Create the new manifest */ if( blob_size(&comment)==0 ){ blob_append(&comment, "(no comment)", -1); } + sCiInfo.pComment = &comment; + sCiInfo.pCksum = useCksum ? &cksum1 : 0; if( forceDelta ){ blob_zero(&manifest); }else{ - create_manifest(&manifest, 0, 0, &comment, vid, + create_manifest(&manifest, 0, 0, vid, &sCiInfo, &szB); +#if 0 !allowOlder && !forceFlag, useCksum ? &cksum1 : 0, zDateOvrd, zUserOvrd, zBranch, zColor, zBrClr, azTag, &szB); +#endif } /* See if a delta-manifest would be more appropriate */ if( !forceBaseline ){ const char *zBaselineUuid; @@ -1448,14 +1469,17 @@ zBaselineUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", vid); pBaseline = pParent; } if( pBaseline ){ Blob delta; - create_manifest(&delta, zBaselineUuid, pBaseline, &comment, vid, + create_manifest(&delta, zBaselineUuid, pBaseline, vid, &sCiInfo, &szD); + +#if 0 !allowOlder && !forceFlag, useCksum ? &cksum1 : 0, zDateOvrd, zUserOvrd, zBranch, zColor, zBrClr, azTag, &szD); +#endif /* ** At this point, two manifests have been constructed, either of ** which would work for this checkin. The first manifest (held ** in the "manifest" variable) is a baseline manifest and the second ** (held in variable named "delta") is a delta manifest. The Index: src/db.c ================================================================== --- src/db.c +++ src/db.c @@ -2104,13 +2104,10 @@ { "https-login", 0, 0, 0, "off" }, { "ignore-glob", 0, 40, 1, "" }, { "localauth", 0, 0, 0, "off" }, { "main-branch", 0, 40, 0, "trunk" }, { "manifest", 0, 0, 1, "off" }, -#ifdef FOSSIL_ENABLE_MARKDOWN - { "markdown", 0, 0, 0, "off" }, -#endif { "max-upload", 0, 25, 0, "250000" }, { "mtime-changes", 0, 0, 0, "on" }, { "pgp-command", 0, 40, 0, "gpg --clearsign -o " }, { "proxy", 0, 32, 0, "off" }, { "relative-paths",0, 0, 0, "on" }, Index: src/doc.c ================================================================== --- src/doc.c +++ src/doc.c @@ -169,10 +169,11 @@ { "lzh", 3, "application/octet-stream" }, { "m", 1, "text/plain" }, { "m3u", 3, "audio/x-mpegurl" }, { "man", 3, "application/x-troff-man" }, { "markdown", 8, "text/x-markdown" }, + { "md", 2, "text/x-markdown" }, { "me", 2, "application/x-troff-me" }, { "mesh", 4, "model/mesh" }, { "mid", 3, "audio/midi" }, { "midi", 4, "audio/midi" }, { "mif", 3, "application/x-mif" }, @@ -504,13 +505,11 @@ }else{ style_header("Documentation"); wiki_convert(&filebody, 0, WIKI_BUTTONS); } style_footer(); -#ifdef FOSSIL_ENABLE_MARKDOWN - }else if( fossil_strcmp(zMime, "text/x-markdown")==0 - && db_get_boolean("markdown", 0) ){ + }else if( fossil_strcmp(zMime, "text/x-markdown")==0 ){ Blob title = BLOB_INITIALIZER; Blob tail = BLOB_INITIALIZER; markdown_to_html(&filebody, &title, &tail); if( blob_size(&title)>0 ){ style_header(blob_str(&title)); @@ -517,11 +516,10 @@ }else{ style_header("Documentation"); } blob_append(cgi_output_blob(), blob_buffer(&tail), blob_size(&tail)); style_footer(); -#endif }else if( fossil_strcmp(zMime, "text/plain")==0 ){ style_header("Documentation"); @
     @ %h(blob_str(&filebody))
     @ 
Index: src/main.c ================================================================== --- src/main.c +++ src/main.c @@ -780,14 +780,10 @@ #endif #if defined(FOSSIL_ENABLE_JSON) ++count; fossil_print("\tJSON (API %s)\n", FOSSIL_JSON_API_VERSION); #endif -#if defined(FOSSIL_ENABLE_MARKDOWN) - ++count; - fossil_print("\tMARKDOWN\n"); -#endif if( !count ){ fossil_print("\tNo optional features were enabled.\n"); } } } Index: src/makemake.tcl ================================================================== --- src/makemake.tcl +++ src/makemake.tcl @@ -380,14 +380,10 @@ #### Enable JSON (http://www.json.org) support using "cson" # # FOSSIL_ENABLE_JSON = 1 -#### Enable markdown support -# -# FOSSIL_ENABLE_MARKDOWN = 1 - #### Enable HTTPS support via OpenSSL (links to libssl and libcrypto) # # FOSSIL_ENABLE_SSL = 1 #### Enable scripting support via Tcl/Tk @@ -525,16 +521,10 @@ ifdef FOSSIL_ENABLE_JSON TCC += -DFOSSIL_ENABLE_JSON=1 RCC += -DFOSSIL_ENABLE_JSON=1 endif -# With markdown support -ifdef FOSSIL_ENABLE_MARKDOWN -TCC += -DFOSSIL_ENABLE_MARKDOWN=1 -RCC += -DFOSSIL_ENABLE_MARKDOWN=1 -endif - #### We add the -static option here so that we can build a static # executable that will run in a chroot jail. # LIB = -static @@ -966,13 +956,10 @@ ZLIB = zlib.lib # Uncomment to enable JSON API # FOSSIL_ENABLE_JSON = 1 -# Uncomment to enable markdown support -# FOSSIL_ENABLE_MARKDOWN = 1 - INCL = -I. -I$(SRCDIR) -I$B\win\include -I$(ZINCDIR) CFLAGS = -nologo -MT -O2 BCC = $(CC) $(CFLAGS) TCC = $(CC) -c $(CFLAGS) $(MSCDEF) $(SSL) $(INCL) @@ -982,15 +969,10 @@ !ifdef FOSSIL_ENABLE_JSON TCC = $(TCC) -DFOSSIL_ENABLE_JSON RCC = $(RCC) -DFOSSIL_ENABLE_JSON !endif - -!ifdef FOSSIL_ENABLE_MARKDOWN -TCC = $(TCC) -DFOSSIL_ENABLE_MARKDOWN -RCC = $(RCC) -DFOSSIL_ENABLE_MARKDOWN -!endif } regsub -all {[-]D} $SQLITE_OPTIONS {/D} MSC_SQLITE_OPTIONS set j " \\\n " writeln "SQLITE_OPTIONS = [join $MSC_SQLITE_OPTIONS $j]\n" writeln -nonewline "SRC = " Index: src/manifest.c ================================================================== --- src/manifest.c +++ src/manifest.c @@ -68,10 +68,11 @@ double rDate; /* Date and time from D card. 0.0 if no D card. */ char *zUser; /* Name of the user from the U card. */ char *zRepoCksum; /* MD5 checksum of the baseline content. R card. */ char *zWiki; /* Text of the wiki page. W card. */ char *zWikiTitle; /* Name of the wiki page. L card. */ + char *zMimetype; /* Mime type of wiki or comment text. N card. */ double rEventDate; /* Date of an event. E card. */ char *zEventId; /* UUID for an event. E card. */ char *zTicketUuid; /* UUID for a ticket. K card. */ char *zAttachName; /* Filename of an attachment. A card. */ char *zAttachSrc; /* UUID of document being attached. A card. */ @@ -642,10 +643,23 @@ if( i>0 && fossil_strcmp(p->azCChild[i-1], zUuid)>=0 ){ SYNTAX("M-card in the wrong order"); } break; } + + /* + ** N + ** + ** An N-line identifies the mimetype of wiki or comment text. + */ + case 'N': { + if( p->zMimetype!=0 ) SYNTAX("more than one N-card"); + p->zMimetype = next_token(&x,0); + if( p->zMimetype==0 ) SYNTAX("missing mimetype on N-card"); + defossilize(p->zMimetype); + break; + } /* ** P ... ** ** Specify one or more other artifacts where are the parents of @@ -858,10 +872,11 @@ || p->zTicketUuid || p->zWiki || p->zWikiTitle || p->zEventId || p->zAttachName + || p->zMimetype ){ SYNTAX("cluster contains a card other than M- or Z-"); } if( !seenZ ) SYNTAX("missing Z-card on cluster"); p->type = CFTYPE_CLUSTER; @@ -873,10 +888,11 @@ if( p->nCChild>0 ) SYNTAX("M-card in ticket"); if( p->nTag>0 ) SYNTAX("T-card in ticket"); if( p->zTicketUuid==0 ) SYNTAX("missing K-card in ticket"); if( p->zUser==0 ) SYNTAX("missing U-card in ticket"); if( p->zAttachName ) SYNTAX("A-card in ticket"); + if( p->zMimetype) SYNTAX("N-card in ticket"); if( !seenZ ) SYNTAX("missing Z-card in ticket"); p->type = CFTYPE_TICKET; }else if( p->zEventId ){ if( p->rDate<=0.0 ) SYNTAX("missing date for event"); if( p->nCChild>0 ) SYNTAX("M-card in event"); @@ -903,10 +919,11 @@ if( p->rDate<=0.0 ) SYNTAX("date missing on tag"); if( p->nParent>0 ) SYNTAX("P-card on tag"); if( p->zWikiTitle ) SYNTAX("L-card on tag"); if( p->zTicketUuid ) SYNTAX("K-card in tag"); if( p->zAttachName ) SYNTAX("A-card in tag"); + if( p->zMimetype ) SYNTAX("N-card in tag"); if( !seenZ ) SYNTAX("missing Z-card on tag"); p->type = CFTYPE_CONTROL; }else if( p->zAttachName ){ if( p->nCChild>0 ) SYNTAX("M-card in attachment"); if( p->rDate<=0.0 ) SYNTAX("missing date in attachment"); Index: src/markdown.c ================================================================== --- src/markdown.c +++ src/markdown.c @@ -17,12 +17,10 @@ ** ** This file contains code to parse a blob containing markdown text, ** using an external renderer. */ -#ifdef FOSSIL_ENABLE_MARKDOWN - #include "config.h" #include "markdown.h" #include #include @@ -2238,7 +2236,5 @@ } blob_zero(&rndr.refs); blobarray_zero(rndr.work, rndr.make.max_work_stack); fossil_free(rndr.work); } - -#endif /* def FOSSIL_ENABLE_MARKDOWN */ Index: src/markdown_html.c ================================================================== --- src/markdown_html.c +++ src/markdown_html.c @@ -17,12 +17,10 @@ ** ** This file contains callbacks for the markdown parser that generate ** XHTML output. */ -#ifdef FOSSIL_ENABLE_MARKDOWN - #include "config.h" #include "markdown_html.h" #if INTERFACE @@ -405,7 +403,5 @@ }; blob_reset(output_title); blob_reset(output_body); markdown(output_body, input_markdown, &html_renderer); } - -#endif /* def FOSSIL_ENABLE_MARKDOWN */ Index: src/th_main.c ================================================================== --- src/th_main.c +++ src/th_main.c @@ -304,15 +304,13 @@ #if defined(FOSSIL_ENABLE_JSON) else if( 0 == fossil_strnicmp( zArg, "json", 4 ) ){ rc = 1; } #endif -#if defined(FOSSIL_ENABLE_MARKDOWN) else if( 0 == fossil_strnicmp( zArg, "markdown", 8 ) ){ rc = 1; } -#endif if( g.thTrace ){ Th_Trace("[hasfeature %#h] => %d
\n", argl[1], zArg, rc); } Th_SetResultInt(interp, rc); return TH_OK; ADDED test/markdown-test1.md Index: test/markdown-test1.md ================================================================== --- /dev/null +++ test/markdown-test1.md @@ -0,0 +1,25 @@ + +Markdown Formatter Test Document +================================ + +This document is designed to test the markdown formatter. + + * A bullet item. + * A subitem + * Second bullet + +More text + + 1. Enumeration + 1.1. Subitem 1 + 1.2. Subitem 2 + 2. Second enumeration. + +Another paragraph. + + + +Other Features +-------------- + +Text can show *emphasis* or _emphasis_ or **strong emphassis**. Index: win/Makefile.mingw ================================================================== --- win/Makefile.mingw +++ win/Makefile.mingw @@ -44,14 +44,10 @@ #### Enable JSON (http://www.json.org) support using "cson" # # FOSSIL_ENABLE_JSON = 1 -#### Enable markdown support -# -# FOSSIL_ENABLE_MARKDOWN = 1 - #### Enable HTTPS support via OpenSSL (links to libssl and libcrypto) # # FOSSIL_ENABLE_SSL = 1 #### Enable scripting support via Tcl/Tk @@ -189,16 +185,10 @@ ifdef FOSSIL_ENABLE_JSON TCC += -DFOSSIL_ENABLE_JSON=1 RCC += -DFOSSIL_ENABLE_JSON=1 endif -# With markdown support -ifdef FOSSIL_ENABLE_MARKDOWN -TCC += -DFOSSIL_ENABLE_MARKDOWN=1 -RCC += -DFOSSIL_ENABLE_MARKDOWN=1 -endif - #### We add the -static option here so that we can build a static # executable that will run in a chroot jail. # LIB = -static Index: win/Makefile.msc ================================================================== --- win/Makefile.msc +++ win/Makefile.msc @@ -26,13 +26,10 @@ ZLIB = zlib.lib # Uncomment to enable JSON API # FOSSIL_ENABLE_JSON = 1 -# Uncomment to enable markdown support -# FOSSIL_ENABLE_MARKDOWN = 1 - INCL = -I. -I$(SRCDIR) -I$B\win\include -I$(ZINCDIR) CFLAGS = -nologo -MT -O2 BCC = $(CC) $(CFLAGS) TCC = $(CC) -c $(CFLAGS) $(MSCDEF) $(SSL) $(INCL) @@ -43,15 +40,10 @@ !ifdef FOSSIL_ENABLE_JSON TCC = $(TCC) -DFOSSIL_ENABLE_JSON RCC = $(RCC) -DFOSSIL_ENABLE_JSON !endif -!ifdef FOSSIL_ENABLE_MARKDOWN -TCC = $(TCC) -DFOSSIL_ENABLE_MARKDOWN -RCC = $(RCC) -DFOSSIL_ENABLE_MARKDOWN -!endif - SQLITE_OPTIONS = /DSQLITE_OMIT_LOAD_EXTENSION=1 \ /DSQLITE_THREADSAFE=0 \ /DSQLITE_DEFAULT_FILE_FORMAT=4 \ /DSQLITE_ENABLE_STAT3 \ /Dlocaltime=fossil_localtime \ Index: www/fileformat.wiki ================================================================== --- www/fileformat.wiki +++ www/fileformat.wiki @@ -99,10 +99,11 @@
B baseline-manifest
C checkin-comment
D time-and-date-stamp
F filename SHA1-hash permissions old-name
+N mimetype
P SHA1-hash+
Q (+|-)SHA1-hash ?SHA1-hash?
R repository-checksum
T (+|-|*)tag-name * ?value?
U user-login
@@ -158,10 +159,14 @@ if desired but is optional. The file format might be extended with new permission letters in the future. The optional 4th argument is the name of the same file as it existed in the parent check-in. If the name of the file is unchanged from its parent, then the 4th argument is omitted. + +A manifest has zero or one N-cards. The N-card specifies the mimetype for the +text in the comment of the C-card. If the N-card is omitted, a default mimetype +is used. A manifest has zero or one P-cards. Most manifests have one P-card. The P-card has a varying number of arguments that defines other manifests from which the current manifest is derived. Each argument is an 40-character lowercase @@ -343,19 +348,23 @@ the following card types:
D time-and-date-stamp
L wiki-title
+N mimetype
P parent-artifact-id+
U user-name
W size \n text \n
Z checksum
The D card is the date and time when the wiki page was edited. The P card specifies the parent wiki pages, if any. The L card -gives the name of the wiki page. The U card specifies the login +gives the name of the wiki page. The optional N card specifies +the mimetype of the wiki text. If the N card is omitted, the +mimetype is assumed to be text/x-fossil. +The U card specifies the login of the user who made this edit to the wiki page. The Z card is the usual checksum over the either artifact and is required. The W card is used to specify the text of the wiki page. The argument to the W card is an integer which is the number of bytes @@ -422,10 +431,11 @@
A filename target ?source?
C comment
D time-and-date-stamp
+N mimetype
U user-name
Z checksum
The A card specifies a filename for the attachment in its first argument. @@ -438,10 +448,14 @@ The C card is an optional comment describing what the attachment is about. The C card is optional, but there can only be one. A single D card is required to give the date and time when the attachment was applied. + +There may be zero or one N cards. The N card specifies the mimetype of the +comment text provided in the C card. If the N card is omitted, the C card +mimetype is taken to be text/plain. A single U card gives the name of the user to added the attachment. If an attachment is added anonymously, then the U card may be omitted. The Z card is the usual checksum over the rest of the attachment artifact. @@ -459,10 +473,11 @@
C comment
D time-and-date-stamp
E event-time event-id
+N mimetype
P parent-artifact-id+
T +tag-name * value
U user-name
W size \n text \n
Z checksum @@ -478,10 +493,15 @@ A single E card gives the time of the event (the point on the timeline where the event is displayed) and a unique identifier for the event. When there are multiple artifacts with the same event-id, the one with the most recent D card is the only one used. The event-id must be a 40-character lower-case hexadecimal string. + +The optional N card specifies the mimetype of the text of the event +that is contained in the W card. If the N card is omitted, then the +W card text mimetype is assumed to be text/x-fossil, which is the +Fossil wiki format. The option P card specifies a prior event with the same event-id from which the current event is an edit. The P card is a hint to the system that it might be space efficient to store one event as a delta of the other. @@ -628,10 +648,20 @@         + +N mimetype +X +  +  +X +  +X +X + P uuid ... X