Commit graph

279 commits

Author SHA1 Message Date
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
yuin
21b4a046d0 Fix bugs in footnotes 2019-07-24 20:55:37 +09:00
yuin
19b18e85fc Fix bug found in fuzzing 2019-07-24 20:16:54 +09:00
yuin
883918a85c Fix bugs found in fuzzing 2019-07-18 18:01:01 +09:00
Yusuke Inuzuka
36e42c4e73
Merge pull request #17 from litao91/fixlist
Fix inaccurate indent calculation of list_item and add extra test
2019-07-16 17:24:29 +09:00
LI Tao
6369ad43e8 Fix inaccurate indent calculation of list_item and add extra test to cover the case 2019-07-16 13:05:14 +08:00
Yusuke Inuzuka
032792ae55
Update README.md 2019-07-15 11:40:31 +09:00
Yusuke Inuzuka
b7348f0573
Merge pull request #14 from litao91/mathjax
Mention mathjax plugin in README.md
2019-07-15 11:39:05 +09:00
LI Tao
0fc2859377 Mention mathjax plugin in README.md 2019-07-15 05:59:08 +08:00
yuin
57c4df05d5 Merge branch 'master' of github.com:yuin/goldmark 2019-07-12 18:52:32 +09:00
yuin
dd1590372c Add a new attribute parser 2019-07-12 18:52:15 +09:00
Yusuke Inuzuka
8aee2d32fd
Update README.md 2019-07-09 17:43:07 +09:00
yuin
23ace7da03 Add goldmark-meta to the README 2019-05-30 18:31:55 +09:00
yuin
05645dd3c4 Add String node 2019-05-30 16:07:04 +09:00
yuin
7b1dd7b221 Issue #12 : dos style newline breaks fence code block 2019-05-23 11:27:25 +09:00
Yusuke Inuzuka
9b1570bcde
Merge pull request #10 from mironovalexey/patch-2
Update README.md
2019-05-19 14:50:01 +09:00
Alexey Mironov
9cf9f6802e
Update README.md
To simplify a copy-paste.
2019-05-19 07:41:10 +03:00
Yusuke Inuzuka
ddce9bf23e
Update README.md 2019-05-17 11:24:44 +09:00
Yusuke Inuzuka
3802559573
Merge pull request #9 from dertseha/patch-1
fixed typo
2019-05-17 11:23:30 +09:00
Christian Haas
8df88b3d75
fixed typo 2019-05-16 22:10:05 +02:00
yuin
4586ec683b Rename test function 2019-05-16 19:53:54 +09:00
yuin
f95910174c Merge branch 'master' of https://github.com/yuin/goldmark 2019-05-16 19:47:05 +09:00
yuin
2ddc99baff Add extension tests, Fix bugs in extensions 2019-05-16 19:46:36 +09:00
Yusuke Inuzuka
7d92c09d44
Update README.md 2019-05-16 12:40:01 +09:00