Commit Graph
8 Commits
Author SHA1 Message Date
David Parsons 3aa4343255 Rework all of the test cases so they use tests/functions.sh,
which gives me the ability to do verbose and nonverbose test
suite running (`VERBOSE=1 make test` is the traditional output
now, and `make test` just gives pass/fail on each .t file)
2010-02-11 23:13:29 -08:00
David Parsons e0ce21fa56 Version 1.6.1; fix
1. two security holes (scripting attacks via
    stupid oversights that I never had test cases
    for) consisting of
     * if explicit html is forbidden, I was putting out
       a `<` then streaming out text until I reached
       a '>'.  So if someone did `<hi <script>attack<hi</script>`,
       it would work, and
     * I was being overly greedy about escaping (with \\)
       `"` and `'`, so a malformed title string could contain
       arbitrary text, up to and including scripts.

 2. three markdown.pl compatability cases
     * lines at the end of a paragraph never get `<br/>`'ed,
     * blockquotes can be indented up to 3 spaces,
     * SETEXT-style header lines can have trailing spaces,

and tweak one more markdown.pl compatability case, in
that list items absorb new paragraphs if they're indented
at all.  The reference implementation is somewhat pathological
about how it treats nested lists (in a way that I do not wish
to follow) but I changed my "subsequent paragraph snarf" code
in `markdown.c` to absorb paragraphs indented by at least the
indent level of the list (so if the list is indented two spaces,
following paragraphs indented two spaces will be absorbed.)
2010-02-01 22:28:32 -08:00
David Parsons ebdd489ed7 1. Fix a bug in generate.c where MKD_NO_EXT was not being handled.
2. Add -fext to the options for the markdown program
3. `try`ify a bunch more of the test cases.
2009-06-17 14:30:43 -07:00
David Parsons 46f934d147 Revise a whole bunch of test cases to use my try function.
Find and fix a bug where a url with an embedded double quote
 is printed out with that doublequote in plaintext.
2009-06-17 11:39:55 -07:00
David Parsons fd212c1c30 1. When testing, use my own tool cols instead of cut (cut doesn't
exist on plan9) and `grep` (with appropriate backslashing) instead
   of `fgrep` (`fgrep` doesn't exist on plan9) or `grep -F` (`-F` option
   doesn't exist on plan9?)
2. move the source for `echo` and `cols` into the new `tools` directory.
2009-06-14 10:23:28 -07:00
David Parsons 3671ed6994 1. Rework maybe_tag_or_link() into three functions; maybe_tag_or_link()
is for `<`automatic links`>`, the new function `maybe_autolink()` is
   for reddit-style inline autolinks, and the new function
   `process_possible_link()` handles the formatting of the token picked
    up by `maybe_tag_or_link()` or `maybe_autolink()`.

2. Fix a bug in `ishdr()` so that it won't pick up a line containing
   a single `#` and emit it as a `<h0>`.

3. Modify the behavior of backslash escaping in `parenthetical()` so
   that all punctuation can be escaped.
2009-06-12 23:26:11 -07:00
David Parsons 15400f86a3 Three changes to etx header processing:
1. don't be aggressive when looking for etx headers.  Lines
   beginning with # WILL be an etx header, no matter what.
2. don't forget to trim trailing spaces.
3. The single line `##` translates to `<h1>#</h1>`
2008-09-29 11:20:39 -07:00
David Parsons 27feae6177 1. Add a test for single-character ETX headers.
2. Add a test for a null list.
3. modify the header detector to not eat space both forward and backwards
   (causes single-character headers to be ignored.)
2008-09-02 22:33:15 -07:00