-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support \hdashline #1407
Support \hdashline #1407
Conversation
Support `\hdashline` from package `arydshln`. This PR acts as a complement to PR #1395. Similarly to #1395, the dashed line is rendered as `border-bottom-style: dashed;`. That does not exactly match the `dashsegment` and `dashgap` lengths in `arydshln`, but it does render black lines with sharp edges.
Codecov Report
@@ Coverage Diff @@
## master #1407 +/- ##
==========================================
- Coverage 82.3% 82.28% -0.03%
==========================================
Files 77 77
Lines 4324 4330 +6
Branches 750 752 +2
==========================================
+ Hits 3559 3563 +4
- Misses 663 665 +2
Partials 102 102
Continue to review full report at Codecov.
|
@ronkok thanks for including |
@kevinbarabash You're welcome. Since |
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.
Looking good. I have one main comment about the representation.
I also wonder whether we should have a comment somewhere saying that the boolean stores whether it's dashed.
src/environments/array.js
Outdated
parser.consume(); | ||
n++; | ||
hlineInfo.unshift(nxt === "\\hdashline"); |
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.
Why is this unshift
instead of push
? In particular, why is the order reversed?
Efficiency wise, it'd be better to push
and then reverse e.g. while returning. Though I can't inagine anyone having more than a few consecutive \hline
s.
src/environments/array.js
Outdated
if (n > 1) { | ||
totalHeight += 0.25; | ||
} | ||
hlines.push({pos: totalHeight, isDashed: hlinesInGap.pop()}); |
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.
Ah, here you are processing in reversed order. I'd find it more intuitive to store them in order, then use a for
loop or map
here.
That's on line 53 of I'm picking up rhe other comments in the upcoming commit. |
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.
Thanks for fixing so quickly. Looks good!
* \newcommand, \renewcommand, \providecommand * Tests * Add comment * Add symbols to the set of already defined things * Add implicitCommands, catch \hline outside array * Add \relax * Move isDefined to be a method of MacroExpander * Namespace.has * Reword error messages * Add \hdashline given #1407
Support
\hdashline
from packagearydshln
. This PR acts as a complement to PR #1395.Similarly to #1395, the dashed line is rendered as
border-bottom-style: dashed;
. That does not exactly match thedashsegment
anddashgap
lengths inarydshln
, but it does render black lines with sharp edges.