Skip to content

Preserve section links in ReSpec output #3863

Closed
@ralfhandl

Description

@ralfhandl

Direct links to RFC sections are useful, for example in

matrix | `primitive`, `array`, `object` | `path` | Path-style parameters defined by [RFC6570](https://tools.ietf.org/html/rfc6570#section-3.2.7)
label | `primitive`, `array`, `object` | `path` | Label style parameters defined by [RFC6570](https://tools.ietf.org/html/rfc6570#section-3.2.5)
form | `primitive`, `array`, `object` | `query`, `cookie` | Form style parameters defined by [RFC6570](https://tools.ietf.org/html/rfc6570#section-3.2.8). This option replaces `collectionFormat` with a `csv` (when `explode` is false) or `multi` (when `explode` is true) value from OpenAPI 2.0.
simple | `array` | `path`, `header` | Simple style parameters defined by [RFC6570](https://tools.ietf.org/html/rfc6570#section-3.2.2). This option replaces `collectionFormat` with a `csv` value from OpenAPI 2.0.
.

Unfortunately these currently get lost when running the Markdown sources through ReSpec and result in unspecific #bib-RFC6570 links, see for example https://spec.openapis.org/oas/latest.html#style-values.

A possible solution could be to adapt the md2html processing in

if (line.indexOf('[RFC')>=0) {
line = line.replace(/\[RFC ?([0-9]{1,5})\]/g,function(match,group1){
console.warn('Fixing RFC reference',match,group1);
return '[[!RFC'+group1+']]';
});
}
and produce something like

[[RFC6570]] [section 3.2.7](https://tools.ietf.org/html/rfc6570#section-3.2.7)

that is both a bib-link and a direct link to the relevant RFC section.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions