Skip to content

Commit

Permalink
fix(format): remove dot and colon characters from escape function (#70)
Browse files Browse the repository at this point in the history
  • Loading branch information
dbarria committed Jul 7, 2022
1 parent 2efd0c5 commit 4118600
Show file tree
Hide file tree
Showing 15 changed files with 202 additions and 202 deletions.
62 changes: 31 additions & 31 deletions README.md

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions cmd/gomarkdoc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
import "github.com/princjef/gomarkdoc/cmd/gomarkdoc"
```

Package gomarkdoc provides a command line interface for writing golang documentation in markdown format\.
Package gomarkdoc provides a command line interface for writing golang documentation in markdown format.

See https://github.com/princjef/gomarkdoc for full documentation of this tool\.
See https://github.com/princjef/gomarkdoc for full documentation of this tool.

## Index

Expand All @@ -17,7 +17,7 @@ See https://github.com/princjef/gomarkdoc for full documentation of this tool\.

## type [PackageSpec](<https://github.com/princjef/gomarkdoc/blob/master/cmd/gomarkdoc/command.go#L30-L44>)

PackageSpec defines the data available to the \-\-output option's template\. Information is recomputed for each package generated\.
PackageSpec defines the data available to the \-\-output option's template. Information is recomputed for each package generated.

```go
type PackageSpec struct {
Expand Down
90 changes: 45 additions & 45 deletions format/README.md

Large diffs are not rendered by default.

26 changes: 13 additions & 13 deletions format/formatcore/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import "github.com/princjef/gomarkdoc/format/formatcore"
```

Package formatcore provides utilities for creating formatters like those found in the format package\.
Package formatcore provides utilities for creating formatters like those found in the format package.

## Index

Expand Down Expand Up @@ -38,33 +38,33 @@ Bold converts the provided text to bold
func CodeBlock(code string) string
```

CodeBlock wraps the provided code as a code block\. Language syntax highlighting is not supported\.
CodeBlock wraps the provided code as a code block. Language syntax highlighting is not supported.

## func [Escape](<https://github.com/princjef/gomarkdoc/blob/master/format/formatcore/base.go#L138>)

```go
func Escape(text string) string
```

Escape escapes the special characters in the provided text\, but leaves URLs found intact\. Note that the URLs included must begin with a scheme to skip the escaping\.
Escape escapes the special characters in the provided text, but leaves URLs found intact. Note that the URLs included must begin with a scheme to skip the escaping.

## func [GFMAccordion](<https://github.com/princjef/gomarkdoc/blob/master/format/formatcore/base.go#L101>)

```go
func GFMAccordion(title, body string) string
```

GFMAccordion generates a collapsible content\. The accordion's visible title while collapsed is the provided title and the expanded content is the body\.
GFMAccordion generates a collapsible content. The accordion's visible title while collapsed is the provided title and the expanded content is the body.

## func [GFMAccordionHeader](<https://github.com/princjef/gomarkdoc/blob/master/format/formatcore/base.go#L114>)

```go
func GFMAccordionHeader(title string) string
```

GFMAccordionHeader generates the header visible when an accordion is collapsed\.
GFMAccordionHeader generates the header visible when an accordion is collapsed.

The GFMAccordionHeader is expected to be used in conjunction with GFMAccordionTerminator\(\) when the demands of the body's rendering requires it to be generated independently\. The result looks conceptually like the following:
The GFMAccordionHeader is expected to be used in conjunction with GFMAccordionTerminator\(\) when the demands of the body's rendering requires it to be generated independently. The result looks conceptually like the following:

```
accordion := GFMAccordionHeader("Accordion Title") + "Accordion Body" + GFMAccordionTerminator()
Expand All @@ -76,55 +76,55 @@ accordion := GFMAccordionHeader("Accordion Title") + "Accordion Body" + GFMAccor
func GFMAccordionTerminator() string
```

GFMAccordionTerminator generates the code necessary to terminate an accordion after the body\. It is expected to be used in conjunction with GFMAccordionHeader\(\)\. See GFMAccordionHeader for a full description\.
GFMAccordionTerminator generates the code necessary to terminate an accordion after the body. It is expected to be used in conjunction with GFMAccordionHeader\(\). See GFMAccordionHeader for a full description.

## func [GFMCodeBlock](<https://github.com/princjef/gomarkdoc/blob/master/format/formatcore/base.go#L45>)

```go
func GFMCodeBlock(language, code string) string
```

GFMCodeBlock wraps the provided code as a code block and tags it with the provided language \(or no language if the empty string is provided\)\, using the triple backtick format from GitHub Flavored Markdown\.
GFMCodeBlock wraps the provided code as a code block and tags it with the provided language \(or no language if the empty string is provided\), using the triple backtick format from GitHub Flavored Markdown.

## func [Header](<https://github.com/princjef/gomarkdoc/blob/master/format/formatcore/base.go#L51>)

```go
func Header(level int, text string) (string, error)
```

Header converts the provided text into a header of the provided level\. The level is expected to be at least 1\.
Header converts the provided text into a header of the provided level. The level is expected to be at least 1.

## func [Link](<https://github.com/princjef/gomarkdoc/blob/master/format/formatcore/base.go#L74>)

```go
func Link(text, href string) string
```

Link generates a link with the given text and href values\.
Link generates a link with the given text and href values.

## func [ListEntry](<https://github.com/princjef/gomarkdoc/blob/master/format/formatcore/base.go#L89>)

```go
func ListEntry(depth int, text string) string
```

ListEntry generates an unordered list entry with the provided text at the provided zero\-indexed depth\. A depth of 0 is considered the topmost level of list\.
ListEntry generates an unordered list entry with the provided text at the provided zero\-indexed depth. A depth of 0 is considered the topmost level of list.

## func [Paragraph](<https://github.com/princjef/gomarkdoc/blob/master/format/formatcore/base.go#L126>)

```go
func Paragraph(text string) string
```

Paragraph formats a paragraph with the provided text as the contents\.
Paragraph formats a paragraph with the provided text as the contents.

## func [PlainText](<https://github.com/princjef/gomarkdoc/blob/master/format/formatcore/base.go#L175>)

```go
func PlainText(text string) string
```

PlainText converts a markdown string to the plain text that appears in the rendered output\.
PlainText converts a markdown string to the plain text that appears in the rendered output.



Expand Down
2 changes: 1 addition & 1 deletion format/formatcore/base.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ func Paragraph(text string) string {
}

var (
specialCharacterRegex = regexp.MustCompile("([\\\\`*_{}\\[\\]()<>#+-.!~])")
specialCharacterRegex = regexp.MustCompile("([\\\\`*_{}\\[\\]()<>#+\\-!~])")
urlRegex = xurls.Strict() // Require a scheme in URLs
)

Expand Down
4 changes: 2 additions & 2 deletions format/formatcore/base_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ func TestEscape(t *testing.T) {
in, out string
}{
{
in: "plain text",
out: `plain text`,
in: "plain, text.",
out: `plain, text.`,
},
{
in: "**bold** text",
Expand Down
Loading

0 comments on commit 4118600

Please sign in to comment.