Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions test/rdoc/test_rdoc_markdown.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,30 @@
assert_equal '<em>*bold*</em>', @parser.emphasis('*bold*')
end

def test_parse_links
doc = parse <<-MD
[Link to Foo](https://example.com)
MD
expected = doc(verb("[Link to Foo](https://example.com)\n"))

assert_equal(expected, doc)

doc = parse <<-MD
[Link to `Foo`](https://example.com)
MD

expected = doc(para("[Link to <code>Foo</code>](https://example.com)"))

assert_equal(expected, doc)

Check failure on line 48 in test/rdoc/test_rdoc_markdown.rb

View workflow job for this annotation

GitHub Actions / test (3.0, ubuntu-latest)

Failure

<[doc: [para: "[Link to <code>Foo</code>](https://example.com)"]]> expected but was <[doc: [verb: "[Link to `Foo`](https://example.com)\n"]]>. diff: - [doc: [para: "[Link to <code>Foo</code>](https://example.com)"]] ? ^^ ^ ^^^^^^ ^^^^^^^ + [doc: [verb: "[Link to `Foo`](https://example.com)\n"]] ? ^^ ^ ^ ^ ++

Check failure on line 48 in test/rdoc/test_rdoc_markdown.rb

View workflow job for this annotation

GitHub Actions / test (3.2, macos-latest)

Failure

<[doc: [para: "[Link to <code>Foo</code>](https://example.com)"]]> expected but was <[doc: [verb: "[Link to `Foo`](https://example.com)\n"]]>. diff: - [doc: [para: "[Link to <code>Foo</code>](https://example.com)"]] ? ^^ ^ ^^^^^^ ^^^^^^^ + [doc: [verb: "[Link to `Foo`](https://example.com)\n"]] ? ^^ ^ ^ ^ ++

Check failure on line 48 in test/rdoc/test_rdoc_markdown.rb

View workflow job for this annotation

GitHub Actions / test (head, ubuntu-latest)

Failure

<[doc: [para: "[Link to <code>Foo</code>](https://example.com)"]]> expected but was <[doc: [verb: "[Link to `Foo`](https://example.com)\n"]]>. diff: - [doc: [para: "[Link to <code>Foo</code>](https://example.com)"]] ? ^^ ^ ^^^^^^ ^^^^^^^ + [doc: [verb: "[Link to `Foo`](https://example.com)\n"]] ? ^^ ^ ^ ^ ++

Check failure on line 48 in test/rdoc/test_rdoc_markdown.rb

View workflow job for this annotation

GitHub Actions / test (3.1, macos-latest)

Failure

<[doc: [para: "[Link to <code>Foo</code>](https://example.com)"]]> expected but was <[doc: [verb: "[Link to `Foo`](https://example.com)\n"]]>. diff: - [doc: [para: "[Link to <code>Foo</code>](https://example.com)"]] ? ^^ ^ ^^^^^^ ^^^^^^^ + [doc: [verb: "[Link to `Foo`](https://example.com)\n"]] ? ^^ ^ ^ ^ ++

Check failure on line 48 in test/rdoc/test_rdoc_markdown.rb

View workflow job for this annotation

GitHub Actions / test (3.3, ubuntu-latest)

Failure

<[doc: [para: "[Link to <code>Foo</code>](https://example.com)"]]> expected but was <[doc: [verb: "[Link to `Foo`](https://example.com)\n"]]>. diff: - [doc: [para: "[Link to <code>Foo</code>](https://example.com)"]] ? ^^ ^ ^^^^^^ ^^^^^^^ + [doc: [verb: "[Link to `Foo`](https://example.com)\n"]] ? ^^ ^ ^ ^ ++

Check failure on line 48 in test/rdoc/test_rdoc_markdown.rb

View workflow job for this annotation

GitHub Actions / test (3.3, macos-latest)

Failure

<[doc: [para: "[Link to <code>Foo</code>](https://example.com)"]]> expected but was <[doc: [verb: "[Link to `Foo`](https://example.com)\n"]]>. diff: - [doc: [para: "[Link to <code>Foo</code>](https://example.com)"]] ? ^^ ^ ^^^^^^ ^^^^^^^ + [doc: [verb: "[Link to `Foo`](https://example.com)\n"]] ? ^^ ^ ^ ^ ++

Check failure on line 48 in test/rdoc/test_rdoc_markdown.rb

View workflow job for this annotation

GitHub Actions / test (3.4, ubuntu-latest)

Failure

<[doc: [para: "[Link to <code>Foo</code>](https://example.com)"]]> expected but was <[doc: [verb: "[Link to `Foo`](https://example.com)\n"]]>. diff: - [doc: [para: "[Link to <code>Foo</code>](https://example.com)"]] ? ^^ ^ ^^^^^^ ^^^^^^^ + [doc: [verb: "[Link to `Foo`](https://example.com)\n"]] ? ^^ ^ ^ ^ ++

Check failure on line 48 in test/rdoc/test_rdoc_markdown.rb

View workflow job for this annotation

GitHub Actions / test (head, macos-latest)

Failure

<[doc: [para: "[Link to <code>Foo</code>](https://example.com)"]]> expected but was <[doc: [verb: "[Link to `Foo`](https://example.com)\n"]]>. diff: - [doc: [para: "[Link to <code>Foo</code>](https://example.com)"]] ? ^^ ^ ^^^^^^ ^^^^^^^ + [doc: [verb: "[Link to `Foo`](https://example.com)\n"]] ? ^^ ^ ^ ^ ++

Check failure on line 48 in test/rdoc/test_rdoc_markdown.rb

View workflow job for this annotation

GitHub Actions / test (3.0, macos-latest)

Failure

<[doc: [para: "[Link to <code>Foo</code>](https://example.com)"]]> expected but was <[doc: [verb: "[Link to `Foo`](https://example.com)\n"]]>. diff: - [doc: [para: "[Link to <code>Foo</code>](https://example.com)"]] ? ^^ ^ ^^^^^^ ^^^^^^^ + [doc: [verb: "[Link to `Foo`](https://example.com)\n"]] ? ^^ ^ ^ ^ ++

Check failure on line 48 in test/rdoc/test_rdoc_markdown.rb

View workflow job for this annotation

GitHub Actions / test (3.4, macos-latest)

Failure

<[doc: [para: "[Link to <code>Foo</code>](https://example.com)"]]> expected but was <[doc: [verb: "[Link to `Foo`](https://example.com)\n"]]>. diff: - [doc: [para: "[Link to <code>Foo</code>](https://example.com)"]] ? ^^ ^ ^^^^^^ ^^^^^^^ + [doc: [verb: "[Link to `Foo`](https://example.com)\n"]] ? ^^ ^ ^ ^ ++

Check failure on line 48 in test/rdoc/test_rdoc_markdown.rb

View workflow job for this annotation

GitHub Actions / test (3.1, ubuntu-latest)

Failure

<[doc: [para: "[Link to <code>Foo</code>](https://example.com)"]]> expected but was <[doc: [verb: "[Link to `Foo`](https://example.com)\n"]]>. diff: - [doc: [para: "[Link to <code>Foo</code>](https://example.com)"]] ? ^^ ^ ^^^^^^ ^^^^^^^ + [doc: [verb: "[Link to `Foo`](https://example.com)\n"]] ? ^^ ^ ^ ^ ++

Check failure on line 48 in test/rdoc/test_rdoc_markdown.rb

View workflow job for this annotation

GitHub Actions / test (3.2, ubuntu-latest)

Failure

<[doc: [para: "[Link to <code>Foo</code>](https://example.com)"]]> expected but was <[doc: [verb: "[Link to `Foo`](https://example.com)\n"]]>. diff: - [doc: [para: "[Link to <code>Foo</code>](https://example.com)"]] ? ^^ ^ ^^^^^^ ^^^^^^^ + [doc: [verb: "[Link to `Foo`](https://example.com)\n"]] ? ^^ ^ ^ ^ ++

Check failure on line 48 in test/rdoc/test_rdoc_markdown.rb

View workflow job for this annotation

GitHub Actions / test (truffleruby, macos-latest)

Failure

<[doc: [para: "[Link to <code>Foo</code>](https://example.com)"]]> expected but was <[doc: [verb: "[Link to `Foo`](https://example.com)\n"]]>. diff: - [doc: [para: "[Link to <code>Foo</code>](https://example.com)"]] ? ^^ ^ ^^^^^^ ^^^^^^^ + [doc: [verb: "[Link to `Foo`](https://example.com)\n"]] ? ^^ ^ ^ ^ ++

Check failure on line 48 in test/rdoc/test_rdoc_markdown.rb

View workflow job for this annotation

GitHub Actions / test (truffleruby-head, macos-latest)

Failure

<[doc: [para: "[Link to <code>Foo</code>](https://example.com)"]]> expected but was <[doc: [verb: "[Link to `Foo`](https://example.com)\n"]]>. diff: - [doc: [para: "[Link to <code>Foo</code>](https://example.com)"]] ? ^^ ^ ^^^^^^ ^^^^^^^ + [doc: [verb: "[Link to `Foo`](https://example.com)\n"]] ? ^^ ^ ^ ^ ++

Check failure on line 48 in test/rdoc/test_rdoc_markdown.rb

View workflow job for this annotation

GitHub Actions / test (truffleruby, ubuntu-latest)

Failure

<[doc: [para: "[Link to <code>Foo</code>](https://example.com)"]]> expected but was <[doc: [verb: "[Link to `Foo`](https://example.com)\n"]]>. diff: - [doc: [para: "[Link to <code>Foo</code>](https://example.com)"]] ? ^^ ^ ^^^^^^ ^^^^^^^ + [doc: [verb: "[Link to `Foo`](https://example.com)\n"]] ? ^^ ^ ^ ^ ++

Check failure on line 48 in test/rdoc/test_rdoc_markdown.rb

View workflow job for this annotation

GitHub Actions / test (3.1, windows-latest)

Failure

<[doc: [para: "[Link to <code>Foo</code>](https://example.com)"]]> expected but was <[doc: [verb: "[Link to `Foo`](https://example.com)\n"]]>. diff: - [doc: [para: "[Link to <code>Foo</code>](https://example.com)"]] ? ^^ ^ ^^^^^^ ^^^^^^^ + [doc: [verb: "[Link to `Foo`](https://example.com)\n"]] ? ^^ ^ ^ ^ ++

Check failure on line 48 in test/rdoc/test_rdoc_markdown.rb

View workflow job for this annotation

GitHub Actions / test (3.0, windows-latest)

Failure

<[doc: [para: "[Link to <code>Foo</code>](https://example.com)"]]> expected but was <[doc: [verb: "[Link to `Foo`](https://example.com)\n"]]>. diff: - [doc: [para: "[Link to <code>Foo</code>](https://example.com)"]] ? ^^ ^ ^^^^^^ ^^^^^^^ + [doc: [verb: "[Link to `Foo`](https://example.com)\n"]] ? ^^ ^ ^ ^ ++

Check failure on line 48 in test/rdoc/test_rdoc_markdown.rb

View workflow job for this annotation

GitHub Actions / test (3.2, windows-latest)

Failure

<[doc: [para: "[Link to <code>Foo</code>](https://example.com)"]]> expected but was <[doc: [verb: "[Link to `Foo`](https://example.com)\n"]]>. diff: - [doc: [para: "[Link to <code>Foo</code>](https://example.com)"]] ? ^^ ^ ^^^^^^ ^^^^^^^ + [doc: [verb: "[Link to `Foo`](https://example.com)\n"]] ? ^^ ^ ^ ^ ++

Check failure on line 48 in test/rdoc/test_rdoc_markdown.rb

View workflow job for this annotation

GitHub Actions / test (truffleruby-head, ubuntu-latest)

Failure

<[doc: [para: "[Link to <code>Foo</code>](https://example.com)"]]> expected but was <[doc: [verb: "[Link to `Foo`](https://example.com)\n"]]>. diff: - [doc: [para: "[Link to <code>Foo</code>](https://example.com)"]] ? ^^ ^ ^^^^^^ ^^^^^^^ + [doc: [verb: "[Link to `Foo`](https://example.com)\n"]] ? ^^ ^ ^ ^ ++

Check failure on line 48 in test/rdoc/test_rdoc_markdown.rb

View workflow job for this annotation

GitHub Actions / test (head, windows-latest)

Failure

<[doc: [para: "[Link to <code>Foo</code>](https://example.com)"]]> expected but was <[doc: [verb: "[Link to `Foo`](https://example.com)\n"]]>. diff: - [doc: [para: "[Link to <code>Foo</code>](https://example.com)"]] ? ^^ ^ ^^^^^^ ^^^^^^^ + [doc: [verb: "[Link to `Foo`](https://example.com)\n"]] ? ^^ ^ ^ ^ ++

Check failure on line 48 in test/rdoc/test_rdoc_markdown.rb

View workflow job for this annotation

GitHub Actions / test (3.3, windows-latest)

Failure

<[doc: [para: "[Link to <code>Foo</code>](https://example.com)"]]> expected but was <[doc: [verb: "[Link to `Foo`](https://example.com)\n"]]>. diff: - [doc: [para: "[Link to <code>Foo</code>](https://example.com)"]] ? ^^ ^ ^^^^^^ ^^^^^^^ + [doc: [verb: "[Link to `Foo`](https://example.com)\n"]] ? ^^ ^ ^ ^ ++

doc = parse <<-MD
[Link to **Foo**](https://example.com)
MD
expected = doc(para("[Link to <b>Foo</b>](https://example.com)"))

assert_equal(expected, doc)
end

def test_parse_auto_link_email
doc = parse "Autolink: <nobody-0+_./!%~$@example>"

Expand Down
Loading