Skip to content

Commit

Permalink
*: Extract into package (#13)
Browse files Browse the repository at this point in the history
* *: Extract into package

Extracts all of the highlight code into a package, so it can be consumed
and imported by other projects.

Thanks for this awesome tool!

* Update README.md

* Fix URL not recognized
Improve isKeyValue function recognizing whether is valid yaml k/v or just a string with a colon

* Releases linked in the README

* temp and zip files

* deals with multiple :

* fix, missing :

* Update README.md

* Update README.md

* Update README.md

Co-authored-by: Andrea Zorzetto <andrea@thatpersonalmail.com>
Co-authored-by: Andrea Zorzetto <andrea.zorzetto@ecs-digital.co.uk>
  • Loading branch information
3 people authored Oct 18, 2020
1 parent ec695e8 commit 6225b10
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions highlight/highlight.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ func Highlight(r io.Reader) (string, error) {
if l.isUrl() {
// Value is a URL
buf.WriteString(url(l))

} else if l.isComment() {
// This line is a comment
buf.WriteString(comment(l))
Expand Down Expand Up @@ -127,7 +126,6 @@ func invalidLine(l yamlLine) string {
func multiline(l yamlLine) string {
return fmt.Sprintf("%v\n", Gray(20-1, l.raw))
}

func url(l yamlLine) string {
return fmt.Sprintf("%v\n", Yellow(l.raw))
}

0 comments on commit 6225b10

Please sign in to comment.