Skip to content

Commit

Permalink
Fix ListBullet0
Browse files Browse the repository at this point in the history
  • Loading branch information
carols10cents committed Oct 20, 2022
1 parent 6e4c1fd commit ef35355
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
20 changes: 11 additions & 9 deletions nostarch/chapter09.md
Original file line number Diff line number Diff line change
Expand Up @@ -892,15 +892,17 @@ guarantee, contract, or invariant has been broken, such as when invalid values,
contradictory values, or missing values are passed to your code—plus one or
more of the following:
Unmatched: ListBullet0
Unmatched: ListBullet0
Unmatched: ListBullet0
If someone calls your code and passes in values that don’t make sense,
it’s best to return an error if you can so the user of the library can decide
what they want to do in that case. However, in cases where continuing could be
* The bad state is something that is unexpected, as opposed to something that
will likely happen occasionally, like a user entering data in the wrong format.
* Your code after this point needs to rely on not being in this bad state,
rather than checking for the problem at every step.
* There’s not a good way to encode this information in the types you use. We’ll
work through an example of what we mean in “Encoding States and Behavior as
Types” on page XX.
If someone calls your code and passes in values that don’t make sense, it’s
best to return an error if you can so the user of the library can decide what
they want to do in that case. However, in cases where continuing could be
insecure or harmful, the best choice might be to call `panic!` and alert the
person using your library to the bug in their code so they can fix it during
development. Similarly, `panic!` is often appropriate if you’re calling
Expand Down
4 changes: 2 additions & 2 deletions tools/docx-to-md.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,11 @@
<xsl:text>&#10;&#10;</xsl:text>
</xsl:template>

<xsl:template match="w:p[w:pPr/w:pStyle[@w:val = 'BulletA' or @w:val = 'BulletB' or @w:val = 'ListPlainA' or @w:val = 'ListPlainB' or @w:val = 'ListBullet' or @w:val = 'ListPlain']]">
<xsl:template match="w:p[w:pPr/w:pStyle[@w:val = 'BulletA' or @w:val = 'BulletB' or @w:val = 'ListPlainA' or @w:val = 'ListPlainB' or @w:val = 'ListBullet' or @w:val = 'ListPlain' or @w:val = 'ListBullet0']]">
<xsl:text>* </xsl:text>
<xsl:apply-templates select="*" />
<xsl:text>&#10;</xsl:text>
<xsl:if test="not(following-sibling::*[1][self::w:p]) or following-sibling::w:p[1][w:pPr/w:pStyle[@w:val != 'BulletA' and @w:val != 'BulletB' and @w:val != 'ListPlainA' and @w:val != 'ListPlainB' and @w:val != 'ListBullet' and @w:val != 'ListPlain']]">
<xsl:if test="not(following-sibling::*[1][self::w:p]) or following-sibling::w:p[1][w:pPr/w:pStyle[@w:val != 'BulletA' and @w:val != 'BulletB' and @w:val != 'ListPlainA' and @w:val != 'ListPlainB' and @w:val != 'ListBullet' and @w:val != 'ListPlain' and @w:val != 'ListBullet0']]">
<xsl:text>&#10;</xsl:text>
</xsl:if>
</xsl:template>
Expand Down

0 comments on commit ef35355

Please sign in to comment.