-
Notifications
You must be signed in to change notification settings - Fork 74
🔧 MAINTAIN: Don't allow None
value for StateBase.src
#73
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
Conversation
when you say the javascript doesn't handle it, you do know that javascript handles indexing very differently to python? You should also look at #32, where this ordinal caching was introduced, and where we specifically introduced the catch of |
Yeah, I'm no JS expert 😄, but hopefully do know some basics.
Out of bounds will not raise for sure, but I'm pretty sure indexing For instance this line https://github.com/markdown-it/markdown-it/blob/1b204ef54063aa7fde055f0e801e234be0a74d1e/lib/rules_inline/state_inline.js#L20 in the JS implementation will surely raise if What would be the use case for initializing a State with If |
I found the MyST-NB usage of |
Codecov Report
@@ Coverage Diff @@
## master #73 +/- ##
=======================================
Coverage 96.10% 96.10%
=======================================
Files 60 60
Lines 3232 3234 +2
=======================================
+ Hits 3106 3108 +2
Misses 126 126
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
StateBase.src
StateBase.src
db7ade3
to
1d63db5
Compare
I think this should be a pretty safe merge now that myst-nb has seen a few releases after the usage of |
StateBase.src
None
value for StateBase.src
Javascript implementation doesn't handle null values for
StateBase.src
, so I think we shouldn't either.Also, it seems the
None
handling isn't fully implemented in allStateBase
subclasses. E.g.StateInline.__init__
will throw an exception when src is None (from the lineself.posMax = len(self.src)
) even though there is None handling in the__init__
function before that.