Skip to content

Commit

Permalink
Fix typos
Browse files Browse the repository at this point in the history
  • Loading branch information
kianmeng authored and marcusklaas committed Jun 19, 2022
1 parent 4d45c33 commit 3d50a20
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
8 changes: 4 additions & 4 deletions src/firstpass.rs
Expand Up @@ -69,7 +69,7 @@ impl<'a, 'b> FirstPass<'a, 'b> {
}

if self.options.contains(Options::ENABLE_FOOTNOTES) {
// finish footnote if it's still open and was preceeded by blank line
// finish footnote if it's still open and was preceded by blank line
if let Some(node_ix) = self.tree.peek_up() {
if let ItemBody::FootnoteDefinition(..) = self.tree[node_ix].item.body {
if self.last_line_blank {
Expand Down Expand Up @@ -864,7 +864,7 @@ impl<'a, 'b> FirstPass<'a, 'b> {
let bytes = self.text.as_bytes();
let mut info_start = start_ix + n_fence_char;
info_start += scan_whitespace_no_nl(&bytes[info_start..]);
// TODO: info strings are typically very short. wouldnt it be faster
// TODO: info strings are typically very short. wouldn't it be faster
// to just do a forward scan here?
let mut ix = info_start + scan_nextline(&bytes[info_start..]);
let info_end = ix - scan_rev_while(&bytes[info_start..ix], is_ascii_whitespace);
Expand Down Expand Up @@ -1277,14 +1277,14 @@ enum TableParseMode {
}

/// Computes the number of header columns in a table line by computing the number of dividing pipes
/// that aren't followed or preceeded by whitespace.
/// that aren't followed or preceded by whitespace.
fn count_header_cols(
bytes: &[u8],
mut pipes: usize,
mut start: usize,
last_pipe_ix: usize,
) -> usize {
// was first pipe preceeded by whitespace? if so, subtract one
// was first pipe preceded by whitespace? if so, subtract one
start += scan_whitespace_no_nl(&bytes[start..]);
if bytes[start] == b'|' {
pipes -= 1;
Expand Down
2 changes: 1 addition & 1 deletion src/linklabel.rs
Expand Up @@ -46,7 +46,7 @@ pub(crate) fn scan_link_label_rest<'t>(
let mut ix = 0;
let mut only_white_space = true;
let mut codepoints = 0;
// no worries, doesnt allocate until we push things onto it
// no worries, doesn't allocate until we push things onto it
let mut label = String::new();
let mut mark = 0;

Expand Down
4 changes: 2 additions & 2 deletions src/parse.rs
Expand Up @@ -62,10 +62,10 @@ pub(crate) enum ItemBody {
MaybeEmphasis(usize, bool, bool),
// quote byte, can_open, can_close
MaybeSmartQuote(u8, bool, bool),
MaybeCode(usize, bool), // number of backticks, preceeded by backslash
MaybeCode(usize, bool), // number of backticks, preceded by backslash
MaybeHtml,
MaybeLinkOpen,
// bool indicates whether or not the preceeding section could be a reference
// bool indicates whether or not the preceding section could be a reference
MaybeLinkClose(bool),
MaybeImage,

Expand Down
2 changes: 1 addition & 1 deletion src/scanners.rs
Expand Up @@ -880,7 +880,7 @@ fn scan_attribute(

/// Scans whitespace and possibly newlines according to the
/// behavior defined by the newline handler. When bytes are skipped,
/// all preceeding non-skipped bytes are pushed to the buffer.
/// all preceding non-skipped bytes are pushed to the buffer.
fn scan_whitespace_with_newline_handler(
data: &[u8],
mut i: usize,
Expand Down
10 changes: 5 additions & 5 deletions tests/lib.rs
Expand Up @@ -262,13 +262,13 @@ fn normalize_node(parent: &Handle, node: &mut Handle) -> bool {
pos != 0,
"If node is not first, then node's position shall not be zero"
);
let mut preceeding = siblings[pos - 1].clone();
let mut preceding = siblings[pos - 1].clone();
'descent: loop {
if let NodeData::Text { .. } = preceeding.data {
if let NodeData::Text { .. } = preceding.data {
break 'descent;
}
preceeding = {
let ch = preceeding.children.borrow();
preceding = {
let ch = preceding.children.borrow();
if ch.len() == 0 {
break 'descent;
}
Expand All @@ -279,7 +279,7 @@ fn normalize_node(parent: &Handle, node: &mut Handle) -> bool {
}
};
}
if let NodeData::Text { ref contents, .. } = preceeding.data {
if let NodeData::Text { ref contents, .. } = preceding.data {
break 'ascent TRAILING_WHITESPACE_RE.is_match(&*contents.borrow());
} else {
break 'ascent false;
Expand Down

0 comments on commit 3d50a20

Please sign in to comment.