Skip to content
This repository has been archived by the owner on Jan 16, 2021. It is now read-only.

Add links to RFC sections, if available #276

Merged
merged 1 commit into from
Jun 15, 2015
Merged

Add links to RFC sections, if available #276

merged 1 commit into from
Jun 15, 2015

Conversation

mdlayher
Copy link
Member

This PR extends rfcPat to also match text such as: RFC 3315, Section 17.2, allowing easy linking to various RFC sections.

Here's the output of a quick test program I put together, with the new changes:

[zsh|matt@nerr-2]:~/tmp/gddo 0 % go run main.go
comments: 
// RFC 3315.
// RFC 3315 does some stuff
// RFC 3315 Section does
// RFC 3315 section 7.
// RFC 3315, Section 1.
// RFC 3315, Section 10.
// RFC 3315, Section 1.1.
// RFC 3315, Section 10.12345.
// RFC 3315, Section 10000.200.

output: <p>
// <a href="http://tools.ietf.org/html/rfc3315">RFC 3315</a>.
// <a href="http://tools.ietf.org/html/rfc3315">RFC 3315</a> does some stuff
// <a href="http://tools.ietf.org/html/rfc3315">RFC 3315</a> Section does
// <a href="http://tools.ietf.org/html/rfc3315#section-7">RFC 3315 section 7</a>.
// <a href="http://tools.ietf.org/html/rfc3315#section-1">RFC 3315, Section 1</a>.
// <a href="http://tools.ietf.org/html/rfc3315#section-10">RFC 3315, Section 10</a>.
// <a href="http://tools.ietf.org/html/rfc3315#section-1.1">RFC 3315, Section 1.1</a>.
// <a href="http://tools.ietf.org/html/rfc3315#section-10.12345">RFC 3315, Section 10.12345</a>.
// <a href="http://tools.ietf.org/html/rfc3315#section-10000.200">RFC 3315, Section 10000.200</a>.
</p>
<pre></pre>

And here's an example on a local gddo-server instance:

selection060

adg added a commit that referenced this pull request Jun 15, 2015
Add links to RFC sections, if available
@adg adg merged commit c6c04a3 into golang:master Jun 15, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants