Commit graph

402 commits

Author SHA1 Message Date
yuin
5334c63923 Change IDs argumnent 2019-12-02 18:24:22 +09:00
yuin
ac8e225cd3 Fix invalid handling of consecutive code spans 2019-12-02 17:13:37 +09:00
yuin
68dcec6ac4 Closes #46 : Add WithIDs option 2019-12-02 14:38:28 +09:00
yuin
6efe809cde Update issue template 2019-12-02 13:23:33 +09:00
yuin
eb2667632a Fixes #48 2019-12-02 13:17:08 +09:00
Yusuke Inuzuka
615d5706c6
Merge pull request #43 from moorereason/clean-lint
Clean lint
2019-12-02 03:17:56 +09:00
yuin
2f292e5b74 Fixes #44, Fixes #45 2019-12-02 03:10:06 +09:00
Cameron Moore
74e1374f5a Use io.ByteWriter 2019-11-29 13:42:55 -06:00
Cameron Moore
ff066ede82 Fix gofmt issues 2019-11-29 13:39:42 -06:00
Cameron Moore
3dc5ebdb17 Fix golint issues 2019-11-29 13:31:28 -06:00
Cameron Moore
2932dadfb3 Fix gofmt formatting 2019-11-29 13:22:11 -06:00
Cameron Moore
748be0c096 Fix shadow declarations 2019-11-29 13:20:34 -06:00
yuin
9f9f8f0e5e Closes #41 2019-11-30 03:33:46 +09:00
yuin
8549b83b0c Fixes gohugoio/hugo#6549 2019-11-29 17:21:05 +09:00
yuin
54fc7c3f18 Closes #40 2019-11-29 17:03:00 +09:00
yuin
b611cd333a Add issue template 2019-11-28 11:39:10 +09:00
yuin
6c55ba55a1 Fixes #36 2019-11-27 03:00:17 +09:00
yuin
4536e57938 Fixes #35 2019-11-25 20:35:02 +09:00
yuin
fba5de7344 Fixes #34 2019-11-24 20:17:02 +09:00
yuin
9dec7e9e8b Fixes #31 2019-11-20 01:10:18 +09:00
yuin
c8c3b41fe0 Update badge 2019-11-18 16:15:15 +09:00
yuin
c999f5a9a7 Fix workflow
gcov2lcov seems failing to handle coverpkg?
2019-11-18 16:06:33 +09:00
yuin
22bbda3653 Fix workflow 2019-11-18 15:42:59 +09:00
yuin
76006af024 Remove .travis.yml 2019-11-18 15:28:31 +09:00
yuin
d51543d817 Fix workflow 2019-11-18 15:25:17 +09:00
yuin
66a1061d96 Fix workflow 2019-11-18 15:23:32 +09:00
yuin
8aefee4a22 migrate travisCI to Github actions 2019-11-18 15:20:39 +09:00
yuin
696c860a32 Update go version 2019-11-16 21:31:10 +09:00
yuin
afc3654ecf Fixes #28, #29 2019-11-16 21:11:57 +09:00
yuin
ea8789f650 Fixed #27 2019-11-11 03:59:36 +09:00
yuin
16b69522a4 Remove the WithWorkers option
Situations that concurrent inline parsing is effective are very limited
due to goroutine overheads and a parse context sharing mutex.
2019-10-31 17:46:02 +09:00
Yusuke Inuzuka
2184586bb2
Update README.md 2019-08-30 22:21:16 +09:00
yuin
13a98719d4 Fix invalid use of lute 2019-08-30 21:54:02 +09:00
Yusuke Inuzuka
187643a437 Performance improvements, Add BlockParser.Trigger 2019-08-30 16:36:00 +09:00
Yusuke Inuzuka
667a2920f2 Change attribute parsing strategy 2019-08-28 20:29:23 +09:00
Yusuke Inuzuka
4a770685c0
Merge pull request #22 from abhinav/no-import-testing
Remove "testing" import from public interface
2019-08-25 20:10:15 +09:00
Abhinav Gupta
8c55e6fa9c Move test utilities to testutil/
This moves the following functions meant for use from tests into a
testutil subpackage.

    func DoTestCase(m Markdown, testCase MarkdownTestCase, t TestingT)
    func DoTestCaseFile(m Markdown, filename string, t TestingT)
    func DoTestCases(m goldmark.Markdown, cases []MarkdownTestCase, t TestingT)

This will help keep the top-level goldmark package clean and limited to
core functionality.

(Note that tests in the top-level goldmark package that make use of
these functions must now use the package name `goldmark_test` so that
they're considered separate from the main `goldmark` package, otherwise
you'll see an import cycle: goldmark imports testutil imports goldmark.)
2019-08-25 03:18:18 -07:00
Abhinav Gupta
f98eb987aa Remove "testing" import from public interface
Currently, the DoTestCase, DoTestCaseFile, and DoTestCases functions,
are exposed as part of the public interface.

    func DoTestCase(m Markdown, testCase MarkdownTestCase, t *testing.T)
    func DoTestCaseFile(m Markdown, filename string, t *testing.T)
    func DoTestCases(m goldmark.Markdown, cases []MarkdownTestCase, t *testing.T)

Implementing these functions requires importing the `testing` package.
Importing the `testing` package [automatically registers][1] a number of
global [command line flags][2].

  [1]: https://golang.org/src/testing/testing.go#L252
  [2]: https://golang.org/cmd/go/#hdr-Testing_flags

The effect of this is that any application using the standard `flag`
package with goldmark will automatically get a number of unwanted
command line flags. This is verifiable with the following program,

    package main

    import (
    	"flag"

    	_ "github.com/yuin/goldmark"
    )

    func main() {
    	flag.Parse()
    }

To fix this, the `testing` import needs to be removed from all non-test
files. There are two ways to go about it,

- If the functions are meant for external use, you can define an
  interface with a subset of the methods of `testing.T` and switch the
  functions to consume that. This is what testing libraries like
  [gomock] and [testify] do.
- If the functions are meant for internal use, you can remove them from
  the public interface of the library and use them only from tests.

  [gomock]: https://godoc.org/github.com/golang/mock/gomock#TestReporter
  [testify]: https://godoc.org/github.com/stretchr/testify/require#TestingT

Since these functions are meant to be used by external extensions, I've
introduced a TestingT interface that is a subset of the functionality
provided by `testing.T`. It supports the standard operations: logging,
skiping, and failing tests,
2019-08-25 03:18:10 -07:00
Yusuke Inuzuka
d7e925c896
Merge pull request #23 from abhinav/iota-types
ast: Specify types for iota-based constants
2019-08-25 17:49:14 +09:00
Abhinav Gupta
45376ddb05 ast: Specify types for iota-based constants
Including the type of a constant improves discoverability because the
constant is listed next to the type in the godocs.

Before:

```
$ go doc -all . WalkStatus
type WalkStatus int
    WalkStatus represents a current status of the Walk function.
```

After:

```shell
$ go doc -all . WalkStatus
type WalkStatus int
    WalkStatus represents a current status of the Walk function.

const (
	// WalkStop indicates no more walking needed.
	WalkStop WalkStatus = iota + 1

	// WalkSkipChildren indicates that Walk wont walk on children of current
	// node.
	WalkSkipChildren

	// WalkContinue indicates that Walk can continue to walk.
	WalkContinue
)
```

This commit the `iota`-based constants in the AST package to follow
this.
2019-08-24 12:17:57 -07:00
Yusuke Inuzuka
b067a12f6b
Copied from #20 2019-08-20 18:33:01 +09:00
Yusuke Inuzuka
3190eb8348
Merge pull request #19 from b3log/master
Simplify logic
2019-08-16 18:17:17 +09:00
Liang Ding
e7035b1993
♻️ Remove redundant check 2019-08-10 00:39:46 +08:00
Liang Ding
008c258471
♻️ Simplify logic 2019-08-09 23:48:38 +08:00
Liang Ding
0c44174564
🎨 Remove redundant slice assignment 2019-08-09 23:46:25 +08:00
Yusuke Inuzuka
7950956e28
Merge pull request #18 from b3log/master
Fix some typos
2019-08-07 19:28:25 +09:00
Liang Ding
6f6884271d
✏️ Fix typos 2019-08-07 18:15:09 +08:00
Liang Ding
d29104889a
✏️ Fix some tyops in doc comments 2019-08-07 18:08:43 +08:00
Yusuke Inuzuka
17a47ea1e7
Update README.md 2019-07-26 10:32:48 +09:00
yuin
a27b0ef209 Fix bugs found in fuzzing 2019-07-25 16:59:07 +09:00