-
Notifications
You must be signed in to change notification settings - Fork 204
introduce a Line class #494
introduce a Line class #494
Conversation
Pull Request Test Coverage Report for Build 3482854805Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
Can we review this sooner? I need it to create PRs to fix the tab related issues. |
We'll need to get this working w/ |
Yes, I think we can use the same way as we did before to fix it. |
f28dfd8
to
6d0c977
Compare
Now it looks better. |
Help me understand the point of |
I found It seems the tab issues could be fixed without using this The idea came from https://github.com/tagnote-app/dart_markdown/blob/master/lib/src/line.dart, but the Line there maintains much more information. |
Also: mind running benchmarks? |
No difference, I have tried. Let me do it again |
just because we're allocating a bit more... |
We might need this |
@kevmoo For example: (See: https://spec.commonmark.org/0.30/#example-5) - foo
→→bar There are 2 space sized <pre><code>foo
</code></pre> More information about tabs behaves: see https://spec.commonmark.org/0.30/#tabs
|
I have added some more comment for the Sorry for this back and forth, it has been a few months since I created this |
Should we continue? I am blocked by this PR. |
@srawlins should really chime in here |
What do we say? |
I will try to get to this today. |
6bfbb75
to
3c87feb
Compare
@srawlins Hi Sam, please don’t forget this one. |
lib/src/line.dart
Outdated
// A line containing no characters, or a line containing only spaces | ||
// (`U+0020`) or tabs (`U+0009`), is called a blank line. | ||
// https://spec.commonmark.org/0.30/#blank-line | ||
bool get isBlankLine => emptyPattern.hasMatch(content); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It'd be interesting to consider how many Line
s are queried for whether they are blank. I suspect it is a high number, but it'd be good to really look. And how many Line
s are queried multiple times whether they are blank. If most isBlankLine
is called on most Line
s, and called multiple times on some Line
s, it might be a win to store this bool
as a final field.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed. The ListSyntax does call isBlankLine
on most lines and also calls multiple times on some lines
lib/src/line.dart
Outdated
this.tabRemaining, | ||
}); | ||
|
||
Map<String, dynamic> toMap() => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this is only called in tests, I don't think it is worth it to implement here.
43653d3
to
fc4e498
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Super cool, great feature, sorry for the delay.
No worries! Thanks! |
* introduce a Line class * Update CHANGELOG * maintain backwards compatibility * Update CHANGELOG * Improve CHANGELOG.md * Improve CHANGELOG.md * Add more comment for tabRemaining * Remove toMap from Line * set `isBlankLine` of `Line` as final * remove extension name LineX
The
Line
is used to maintain thetabRemaining
for now.This is a use case of
Line
, it can also explain the meaning of thetabRemaining
:https://spec.commonmark.org/0.30/#example-6
In this example the
tabRemaining
is the two spaces from blockquote which will be used in the nested indented code block.