steveklabnik/rustdoc

Line breaks in URLs

Closed this issue · 3 comments

Markdown supports line breaks on URLs:

[StackOverflow](
http://stackoverflow.com)

and

[StackOverflow interesting discussion](
    http://stackoverflow.com/this/discussion/has/a/very/
very/very/very/long/long/long/title/title/title)

but currently rustdoc does not (e.g. it inserts %0A in the URLs).

This is bad, because rustfmt cannot format long links, and if one splits them across different lines, rustdoc then fails to link properly.

Testcase (from stdsimd):

/// Round packed single-precision (32-bit) floating point elements in `a`
/// according to the flag `b`. The value of `b` may be as follows:
/// 0x00: Round to the nearest whole number.
/// 0x01: Round down, toward negative infinity.
/// 0x02: Round up, toward positive infinity.
/// 0x03: Truncate the values.
/// For a few additional values options, check [the LLVM docs](
///https://github.com/llvm-mirror/clang/blob/master/lib/Headers/avxintrin.h#L414
/// ).

stdsimd formatting style has a 79 column limit. That is, that link must be split into two lines. Everything I've tried breaks rustdoc.

I don't believe this behavior is part of CommonMark.

Also, are you sure you've filed in the right place? This project can't really render real crates yet.

wrong place ! sorry!