| | @@ -863,13 +863,13 @@ |
| 863 | 863 | blob_appendf(pOut, "=\"%s\"", zVal); |
| 864 | 864 | } |
| 865 | 865 | } |
| 866 | 866 | } |
| 867 | 867 | if (p->iType & MUTYPE_SINGLE){ |
| 868 | | - blob_append(pOut, " /", 2); |
| 868 | + blob_append_string(pOut, " /"); |
| 869 | 869 | } |
| 870 | | - blob_append(pOut, ">", 1); |
| 870 | + blob_append_char(pOut, '>'); |
| 871 | 871 | } |
| 872 | 872 | } |
| 873 | 873 | |
| 874 | 874 | /* |
| 875 | 875 | ** When the markup was parsed, some "\000" may have been inserted. |
| | @@ -1045,11 +1045,11 @@ |
| 1045 | 1045 | */ |
| 1046 | 1046 | static void startAutoParagraph(Renderer *p){ |
| 1047 | 1047 | if( p->wantAutoParagraph==0 ) return; |
| 1048 | 1048 | if( p->state & WIKI_LINKSONLY ) return; |
| 1049 | 1049 | if( p->wikiList==MARKUP_OL || p->wikiList==MARKUP_UL ) return; |
| 1050 | | - blob_append(p->pOut, "<p>", -1); |
| 1050 | + blob_append_string(p->pOut, "<p>"); |
| 1051 | 1051 | p->wantAutoParagraph = 0; |
| 1052 | 1052 | p->inAutoParagraph = 1; |
| 1053 | 1053 | } |
| 1054 | 1054 | |
| 1055 | 1055 | /* |
| | @@ -1382,70 +1382,70 @@ |
| 1382 | 1382 | } |
| 1383 | 1383 | p->state &= ~(AT_NEWLINE|AT_PARAGRAPH); |
| 1384 | 1384 | switch( tokenType ){ |
| 1385 | 1385 | case TOKEN_PARAGRAPH: { |
| 1386 | 1386 | if( inlineOnly ){ |
| 1387 | | - /* blob_append(p->pOut, " ¶ ", -1); */ |
| 1388 | | - blob_append(p->pOut, " ", -1); |
| 1387 | + /* blob_append_string(p->pOut, " ¶ "); */ |
| 1388 | + blob_append_string(p->pOut, " "); |
| 1389 | 1389 | }else{ |
| 1390 | 1390 | if( p->wikiList ){ |
| 1391 | 1391 | popStackToTag(p, p->wikiList); |
| 1392 | 1392 | p->wikiList = 0; |
| 1393 | 1393 | } |
| 1394 | 1394 | endAutoParagraph(p); |
| 1395 | | - blob_append(p->pOut, "\n\n", 1); |
| 1395 | + blob_append_string(p->pOut, "\n\n"); |
| 1396 | 1396 | p->wantAutoParagraph = 1; |
| 1397 | 1397 | } |
| 1398 | 1398 | p->state |= AT_PARAGRAPH|AT_NEWLINE; |
| 1399 | 1399 | break; |
| 1400 | 1400 | } |
| 1401 | 1401 | case TOKEN_NEWLINE: { |
| 1402 | 1402 | if( p->renderFlags & WIKI_NEWLINE ){ |
| 1403 | | - blob_append(p->pOut, "<br>\n", 5); |
| 1403 | + blob_append_string(p->pOut, "<br>\n"); |
| 1404 | 1404 | }else{ |
| 1405 | | - blob_append(p->pOut, "\n", 1); |
| 1405 | + blob_append_string(p->pOut, "\n"); |
| 1406 | 1406 | } |
| 1407 | 1407 | p->state |= AT_NEWLINE; |
| 1408 | 1408 | break; |
| 1409 | 1409 | } |
| 1410 | 1410 | case TOKEN_BUL_LI: { |
| 1411 | 1411 | if( inlineOnly ){ |
| 1412 | | - blob_append(p->pOut, " • ", -1); |
| 1412 | + blob_append_string(p->pOut, " • "); |
| 1413 | 1413 | }else{ |
| 1414 | 1414 | if( p->wikiList!=MARKUP_UL ){ |
| 1415 | 1415 | if( p->wikiList ){ |
| 1416 | 1416 | popStackToTag(p, p->wikiList); |
| 1417 | 1417 | } |
| 1418 | 1418 | endAutoParagraph(p); |
| 1419 | 1419 | pushStack(p, MARKUP_UL); |
| 1420 | | - blob_append(p->pOut, "<ul>", 4); |
| 1420 | + blob_append_string(p->pOut, "<ul>"); |
| 1421 | 1421 | p->wikiList = MARKUP_UL; |
| 1422 | 1422 | } |
| 1423 | 1423 | popStackToTag(p, MARKUP_LI); |
| 1424 | 1424 | startAutoParagraph(p); |
| 1425 | 1425 | pushStack(p, MARKUP_LI); |
| 1426 | | - blob_append(p->pOut, "<li>", 4); |
| 1426 | + blob_append_string(p->pOut, "<li>"); |
| 1427 | 1427 | } |
| 1428 | 1428 | break; |
| 1429 | 1429 | } |
| 1430 | 1430 | case TOKEN_NUM_LI: { |
| 1431 | 1431 | if( inlineOnly ){ |
| 1432 | | - blob_append(p->pOut, " # ", -1); |
| 1432 | + blob_append_string(p->pOut, " # "); |
| 1433 | 1433 | }else{ |
| 1434 | 1434 | if( p->wikiList!=MARKUP_OL ){ |
| 1435 | 1435 | if( p->wikiList ){ |
| 1436 | 1436 | popStackToTag(p, p->wikiList); |
| 1437 | 1437 | } |
| 1438 | 1438 | endAutoParagraph(p); |
| 1439 | 1439 | pushStack(p, MARKUP_OL); |
| 1440 | | - blob_append(p->pOut, "<ol>", 4); |
| 1440 | + blob_append_string(p->pOut, "<ol>"); |
| 1441 | 1441 | p->wikiList = MARKUP_OL; |
| 1442 | 1442 | } |
| 1443 | 1443 | popStackToTag(p, MARKUP_LI); |
| 1444 | 1444 | startAutoParagraph(p); |
| 1445 | 1445 | pushStack(p, MARKUP_LI); |
| 1446 | | - blob_append(p->pOut, "<li>", 4); |
| 1446 | + blob_append_string(p->pOut, "<li>"); |
| 1447 | 1447 | } |
| 1448 | 1448 | break; |
| 1449 | 1449 | } |
| 1450 | 1450 | case TOKEN_ENUM: { |
| 1451 | 1451 | if( inlineOnly ){ |
| | @@ -1455,11 +1455,11 @@ |
| 1455 | 1455 | if( p->wikiList ){ |
| 1456 | 1456 | popStackToTag(p, p->wikiList); |
| 1457 | 1457 | } |
| 1458 | 1458 | endAutoParagraph(p); |
| 1459 | 1459 | pushStack(p, MARKUP_OL); |
| 1460 | | - blob_append(p->pOut, "<ol>", 4); |
| 1460 | + blob_append_string(p->pOut, "<ol>"); |
| 1461 | 1461 | p->wikiList = MARKUP_OL; |
| 1462 | 1462 | } |
| 1463 | 1463 | popStackToTag(p, MARKUP_LI); |
| 1464 | 1464 | startAutoParagraph(p); |
| 1465 | 1465 | pushStack(p, MARKUP_LI); |
| | @@ -1469,22 +1469,22 @@ |
| 1469 | 1469 | } |
| 1470 | 1470 | case TOKEN_INDENT: { |
| 1471 | 1471 | if( !inlineOnly ){ |
| 1472 | 1472 | assert( p->wikiList==0 ); |
| 1473 | 1473 | pushStack(p, MARKUP_BLOCKQUOTE); |
| 1474 | | - blob_append(p->pOut, "<blockquote>", -1); |
| 1474 | + blob_append_string(p->pOut, "<blockquote>"); |
| 1475 | 1475 | p->wantAutoParagraph = 0; |
| 1476 | 1476 | p->wikiList = MARKUP_BLOCKQUOTE; |
| 1477 | 1477 | } |
| 1478 | 1478 | break; |
| 1479 | 1479 | } |
| 1480 | 1480 | case TOKEN_CHARACTER: { |
| 1481 | 1481 | startAutoParagraph(p); |
| 1482 | 1482 | if( z[0]=='<' ){ |
| 1483 | | - blob_append(p->pOut, "<", 4); |
| 1483 | + blob_append_string(p->pOut, "<"); |
| 1484 | 1484 | }else if( z[0]=='&' ){ |
| 1485 | | - blob_append(p->pOut, "&", 5); |
| 1485 | + blob_append_string(p->pOut, "&"); |
| 1486 | 1486 | } |
| 1487 | 1487 | break; |
| 1488 | 1488 | } |
| 1489 | 1489 | case TOKEN_LINK: { |
| 1490 | 1490 | char *zTarget; |
| | @@ -1569,11 +1569,11 @@ |
| 1569 | 1569 | (iDiv = findTagWithId(p, MARKUP_DIV, zId))>=0 |
| 1570 | 1570 | ){ |
| 1571 | 1571 | if( p->inVerbatim ){ |
| 1572 | 1572 | p->inVerbatim = 0; |
| 1573 | 1573 | p->state = p->preVerbState; |
| 1574 | | - blob_append(p->pOut, "</pre>", 6); |
| 1574 | + blob_append_string(p->pOut, "</pre>"); |
| 1575 | 1575 | } |
| 1576 | 1576 | while( p->nStack>iDiv+1 ) popStack(p); |
| 1577 | 1577 | if( p->aStack[iDiv].allowWiki ){ |
| 1578 | 1578 | p->state |= ALLOW_WIKI; |
| 1579 | 1579 | }else{ |
| | @@ -1588,14 +1588,14 @@ |
| 1588 | 1588 | */ |
| 1589 | 1589 | if( p->inVerbatim ){ |
| 1590 | 1590 | if( endVerbatim(p, &markup) ){ |
| 1591 | 1591 | p->inVerbatim = 0; |
| 1592 | 1592 | p->state = p->preVerbState; |
| 1593 | | - blob_append(p->pOut, "</pre>", 6); |
| 1593 | + blob_append_string(p->pOut, "</pre>"); |
| 1594 | 1594 | }else{ |
| 1595 | 1595 | unparseMarkup(&markup); |
| 1596 | | - blob_append(p->pOut, "<", 4); |
| 1596 | + blob_append_string(p->pOut, "<"); |
| 1597 | 1597 | n = 1; |
| 1598 | 1598 | } |
| 1599 | 1599 | }else |
| 1600 | 1600 | |
| 1601 | 1601 | /* Render invalid markup literally. The markup appears in the |
| | @@ -1602,11 +1602,11 @@ |
| 1602 | 1602 | ** final output as plain text. |
| 1603 | 1603 | */ |
| 1604 | 1604 | if( markup.iCode==MARKUP_INVALID ){ |
| 1605 | 1605 | unparseMarkup(&markup); |
| 1606 | 1606 | startAutoParagraph(p); |
| 1607 | | - blob_append(p->pOut, "<", 4); |
| 1607 | + blob_append_string(p->pOut, "<"); |
| 1608 | 1608 | n = 1; |
| 1609 | 1609 | }else |
| 1610 | 1610 | |
| 1611 | 1611 | /* If the markup is not font-change markup ignore it if the |
| 1612 | 1612 | ** font-change-only flag is set. |
| | @@ -1663,19 +1663,19 @@ |
| 1663 | 1663 | p->state |= ALLOW_LINKS; |
| 1664 | 1664 | } |
| 1665 | 1665 | } |
| 1666 | 1666 | if( !vAttrDidAppend ) { |
| 1667 | 1667 | endAutoParagraph(p); |
| 1668 | | - blob_append(p->pOut, "<pre class='verbatim'>",-1); |
| 1668 | + blob_append_string(p->pOut, "<pre class='verbatim'>"); |
| 1669 | 1669 | } |
| 1670 | 1670 | p->wantAutoParagraph = 0; |
| 1671 | 1671 | }else |
| 1672 | 1672 | if( markup.iType==MUTYPE_LI ){ |
| 1673 | 1673 | if( backupToType(p, MUTYPE_LIST)==0 ){ |
| 1674 | 1674 | endAutoParagraph(p); |
| 1675 | 1675 | pushStack(p, MARKUP_UL); |
| 1676 | | - blob_append(p->pOut, "<ul>", 4); |
| 1676 | + blob_append_string(p->pOut, "<ul>"); |
| 1677 | 1677 | } |
| 1678 | 1678 | pushStack(p, MARKUP_LI); |
| 1679 | 1679 | renderMarkup(p->pOut, &markup); |
| 1680 | 1680 | }else |
| 1681 | 1681 | if( markup.iType==MUTYPE_TR ){ |
| | @@ -1686,11 +1686,11 @@ |
| 1686 | 1686 | }else |
| 1687 | 1687 | if( markup.iType==MUTYPE_TD ){ |
| 1688 | 1688 | if( backupToType(p, MUTYPE_TABLE|MUTYPE_TR) ){ |
| 1689 | 1689 | if( stackTopType(p)==MUTYPE_TABLE ){ |
| 1690 | 1690 | pushStack(p, MARKUP_TR); |
| 1691 | | - blob_append(p->pOut, "<tr>", 4); |
| 1691 | + blob_append_string(p->pOut, "<tr>"); |
| 1692 | 1692 | } |
| 1693 | 1693 | pushStack(p, markup.iCode); |
| 1694 | 1694 | renderMarkup(p->pOut, &markup); |
| 1695 | 1695 | } |
| 1696 | 1696 | }else |
| | @@ -1764,11 +1764,11 @@ |
| 1764 | 1764 | wiki_render(&renderer, blob_str(pIn)); |
| 1765 | 1765 | endAutoParagraph(&renderer); |
| 1766 | 1766 | while( renderer.nStack ){ |
| 1767 | 1767 | popStack(&renderer); |
| 1768 | 1768 | } |
| 1769 | | - blob_append(renderer.pOut, "\n", 1); |
| 1769 | + blob_append_char(renderer.pOut, '\n'); |
| 1770 | 1770 | free(renderer.aStack); |
| 1771 | 1771 | } |
| 1772 | 1772 | |
| 1773 | 1773 | /* |
| 1774 | 1774 | ** COMMAND: test-wiki-render |
| | @@ -2204,14 +2204,14 @@ |
| 2204 | 2204 | if( eTag==MARKUP_PRE ){ |
| 2205 | 2205 | if( isCloseTag ){ |
| 2206 | 2206 | nPre--; |
| 2207 | 2207 | blob_append(pOut, zIn, n); |
| 2208 | 2208 | zIn += n; |
| 2209 | | - if( nPre==0 ){ blob_append(pOut, "\n", 1); iCur = 0; } |
| 2209 | + if( nPre==0 ){ blob_append_char(pOut, '\n'); iCur = 0; } |
| 2210 | 2210 | continue; |
| 2211 | 2211 | }else{ |
| 2212 | | - if( iCur && nPre==0 ){ blob_append(pOut, "\n", 1); iCur = 0; } |
| 2212 | + if( iCur && nPre==0 ){ blob_append_char(pOut, '\n'); iCur = 0; } |
| 2213 | 2213 | nPre++; |
| 2214 | 2214 | } |
| 2215 | 2215 | }else if( eType & (MUTYPE_BLOCK|MUTYPE_TABLE) ){ |
| 2216 | 2216 | if( !isCloseTag && nPre==0 && blob_size(pOut)>0 ){ |
| 2217 | 2217 | blob_append(pOut, "\n\n", 1 + (iCur>0)); |
| | @@ -2221,30 +2221,30 @@ |
| 2221 | 2221 | omitSpace = 1; |
| 2222 | 2222 | }else if( (eType & (MUTYPE_LIST|MUTYPE_LI|MUTYPE_TR|MUTYPE_TD))!=0 |
| 2223 | 2223 | || eTag==MARKUP_HR |
| 2224 | 2224 | ){ |
| 2225 | 2225 | if( nPre==0 && (!isCloseTag || (eType&MUTYPE_LIST)!=0) && iCur>0 ){ |
| 2226 | | - blob_append(pOut, "\n", 1); |
| 2226 | + blob_append_char(pOut, '\n'); |
| 2227 | 2227 | iCur = 0; |
| 2228 | 2228 | } |
| 2229 | 2229 | wantSpace = 0; |
| 2230 | 2230 | omitSpace = 1; |
| 2231 | 2231 | } |
| 2232 | 2232 | if( wantSpace && nPre==0 ){ |
| 2233 | 2233 | if( iCur+n+1>=80 ){ |
| 2234 | | - blob_append(pOut, "\n", 1); |
| 2234 | + blob_append_char(pOut, '\n'); |
| 2235 | 2235 | iCur = 0; |
| 2236 | 2236 | }else{ |
| 2237 | | - blob_append(pOut, " ", 1); |
| 2237 | + blob_append_char(pOut, ' '); |
| 2238 | 2238 | iCur++; |
| 2239 | 2239 | } |
| 2240 | 2240 | } |
| 2241 | 2241 | blob_append(pOut, zIn, n); |
| 2242 | 2242 | iCur += n; |
| 2243 | 2243 | wantSpace = 0; |
| 2244 | 2244 | if( eTag==MARKUP_BR || eTag==MARKUP_HR ){ |
| 2245 | | - blob_append(pOut, "\n", 1); |
| 2245 | + blob_append_char(pOut, '\n'); |
| 2246 | 2246 | iCur = 0; |
| 2247 | 2247 | } |
| 2248 | 2248 | }else if( fossil_isspace(zIn[0]) ){ |
| 2249 | 2249 | if( nPre ){ |
| 2250 | 2250 | blob_append(pOut, zIn, n); |
| | @@ -2252,24 +2252,24 @@ |
| 2252 | 2252 | wantSpace = !omitSpace; |
| 2253 | 2253 | } |
| 2254 | 2254 | }else{ |
| 2255 | 2255 | if( wantSpace && nPre==0 ){ |
| 2256 | 2256 | if( iCur+n+1>=80 ){ |
| 2257 | | - blob_append(pOut, "\n", 1); |
| 2257 | + blob_append_char(pOut, '\n'); |
| 2258 | 2258 | iCur = 0; |
| 2259 | 2259 | }else{ |
| 2260 | | - blob_append(pOut, " ", 1); |
| 2260 | + blob_append_char(pOut, ' '); |
| 2261 | 2261 | iCur++; |
| 2262 | 2262 | } |
| 2263 | 2263 | } |
| 2264 | 2264 | blob_append(pOut, zIn, n); |
| 2265 | 2265 | iCur += n; |
| 2266 | 2266 | wantSpace = omitSpace = 0; |
| 2267 | 2267 | } |
| 2268 | 2268 | zIn += n; |
| 2269 | 2269 | } |
| 2270 | | - if( iCur ) blob_append(pOut, "\n", 1); |
| 2270 | + if( iCur ) blob_append_char(pOut, '\n'); |
| 2271 | 2271 | } |
| 2272 | 2272 | |
| 2273 | 2273 | /* |
| 2274 | 2274 | ** COMMAND: test-html-tidy |
| 2275 | 2275 | ** |
| | @@ -2332,11 +2332,11 @@ |
| 2332 | 2332 | if( eTag==MARKUP_TITLE ){ |
| 2333 | 2333 | inTitle = !isCloseTag; |
| 2334 | 2334 | } |
| 2335 | 2335 | if( !isCloseTag && seenText && (eType & (MUTYPE_BLOCK|MUTYPE_TABLE))!=0 ){ |
| 2336 | 2336 | if( nNL==0 ){ |
| 2337 | | - blob_append(pOut, "\n", 1); |
| 2337 | + blob_append_char(pOut, '\n'); |
| 2338 | 2338 | nNL++; |
| 2339 | 2339 | } |
| 2340 | 2340 | nWS = 1; |
| 2341 | 2341 | } |
| 2342 | 2342 | }else if( fossil_isspace(zIn[0]) ){ |
| | @@ -2344,11 +2344,11 @@ |
| 2344 | 2344 | nNL = 0; |
| 2345 | 2345 | if( !inTitle ){ /* '\n' -> ' ' within <title> */ |
| 2346 | 2346 | for(i=0; i<n; i++) if( zIn[i]=='\n' ) nNL++; |
| 2347 | 2347 | } |
| 2348 | 2348 | if( !nWS ){ |
| 2349 | | - blob_append(pOut, nNL ? "\n" : " ", 1); |
| 2349 | + blob_append_char(pOut, nNL ? '\n' : ' '); |
| 2350 | 2350 | nWS = 1; |
| 2351 | 2351 | } |
| 2352 | 2352 | } |
| 2353 | 2353 | }else if( zIn[0]=='&' ){ |
| 2354 | 2354 | char c = '?'; |
| | @@ -2369,28 +2369,28 @@ |
| 2369 | 2369 | break; |
| 2370 | 2370 | } |
| 2371 | 2371 | } |
| 2372 | 2372 | } |
| 2373 | 2373 | if( fossil_isspace(c) ){ |
| 2374 | | - if( nWS==0 && seenText ) blob_append(pOut, &c, 1); |
| 2374 | + if( nWS==0 && seenText ) blob_append_char(pOut, c); |
| 2375 | 2375 | nWS = 1; |
| 2376 | 2376 | nNL = c=='\n'; |
| 2377 | 2377 | }else{ |
| 2378 | | - if( !seenText && !inTitle ) blob_append(pOut, "\n", 1); |
| 2378 | + if( !seenText && !inTitle ) blob_append_char(pOut, '\n'); |
| 2379 | 2379 | seenText = 1; |
| 2380 | 2380 | nNL = nWS = 0; |
| 2381 | | - blob_append(pOut, &c, 1); |
| 2381 | + blob_append_char(pOut, c); |
| 2382 | 2382 | } |
| 2383 | 2383 | }else{ |
| 2384 | | - if( !seenText && !inTitle ) blob_append(pOut, "\n", 1); |
| 2384 | + if( !seenText && !inTitle ) blob_append_char(pOut, '\n'); |
| 2385 | 2385 | seenText = 1; |
| 2386 | 2386 | nNL = nWS = 0; |
| 2387 | 2387 | blob_append(pOut, zIn, n); |
| 2388 | 2388 | } |
| 2389 | 2389 | zIn += n; |
| 2390 | 2390 | } |
| 2391 | | - if( nNL==0 ) blob_append(pOut, "\n", 1); |
| 2391 | + if( nNL==0 ) blob_append_char(pOut, '\n'); |
| 2392 | 2392 | } |
| 2393 | 2393 | |
| 2394 | 2394 | /* |
| 2395 | 2395 | ** COMMAND: test-html-to-text |
| 2396 | 2396 | ** |
| 2397 | 2397 | |