-
Notifications
You must be signed in to change notification settings - Fork 241
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Split attribute block content parsing to a dedicated method
This function receives the range `[first_ix, last_ix]` rather than the range `[begin_ix, end_ix)`. It is because detection of attribute blocks will be often done backward. Attribute blocks are usually suffixed to the standard markdown items (for example `## H2 {.class}` and `![alt](uri){.class}` (this is not yet supported though)). Sometimes they would be easier to parse backward, and sometimes easier to parse forward. In such situations, asymmetric `[begin_ix, end_ix)` could be error-prone since it may require indices to be moved around the boundaries of two different types. (For example, `[rend_ix+1, rbegin_ix+1)` is the same range as `[begin_ix, end_ix)`, but it seems not easy to understand quickly.) The range `[first_ix, last_ix]` with symmetric boundaries will make it easier to create even when the attribute block is detected by backward search, and also easier to read and understand correctly.
- Loading branch information
Showing
1 changed file
with
48 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters