Skip to content

Commit

Permalink
Rework permissive autolinks.
Browse files Browse the repository at this point in the history
 * We have now dedicated run over the inline marks for them.

 * We check more throughly whether it really looks as an URL or e-mail
   address. The old implementation recognized even heavily broken ones.

 * This allows us to be much more careful in order not to cross already
   resolved marks.

 * Share substantial parts of the code between all three types of the
   permissive autolinks (URL, WWW, e-mail).

 * Merge their tests into one file, spec-permissive-autolinks.txt.

 * Add one pathological case which triggered quadratic behavior in the
   old implementation.
  • Loading branch information
mity committed Jan 17, 2024
1 parent a715b88 commit e7c2c70
Show file tree
Hide file tree
Showing 7 changed files with 423 additions and 371 deletions.
12 changes: 2 additions & 10 deletions scripts/run-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,8 @@ echo "CommonMark specification:"
$PYTHON "$TEST_DIR/run-testsuite.py" -s "$TEST_DIR/spec.txt" -p "$PROGRAM"

echo
echo "Permissive e-mail autolinks extension:"
$PYTHON "$TEST_DIR/run-testsuite.py" -s "$TEST_DIR/spec-permissive-email-autolinks.txt" -p "$PROGRAM"

echo
echo "Permissive URL autolinks extension:"
$PYTHON "$TEST_DIR/run-testsuite.py" -s "$TEST_DIR/spec-permissive-url-autolinks.txt" -p "$PROGRAM"

echo
echo "WWW autolinks extension:"
$PYTHON "$TEST_DIR/run-testsuite.py" -s "$TEST_DIR/spec-permissive-www-autolinks.txt" -p "$PROGRAM"
echo "Permissive autolink extensions:"
$PYTHON "$TEST_DIR/run-testsuite.py" -s "$TEST_DIR/spec-permissive-autolinks.txt" -p "$PROGRAM"

echo
echo "Hard soft breaks extension:"
Expand Down
Loading

0 comments on commit e7c2c70

Please sign in to comment.