Skip to content

Commit

Permalink
Allow backticks to trigger monospace when next to punctuation
Browse files Browse the repository at this point in the history
  • Loading branch information
marijnh committed Jan 10, 2014
1 parent 89edc55 commit f0268c4
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 7 deletions.
4 changes: 2 additions & 2 deletions 01_values.txt
Expand Up @@ -246,8 +246,8 @@ And this is the second
There are, of course, situations where you want a backslash in a
string to be just a backslash, not a special code. If two backslashes
follow each other, they will collapse together, and only one will be
left in the resulting string value. This is how the string “++A newline
character is written like "\n"++” can be written:
left in the resulting string value. This is how the string “`A newline
character is written like "\n"`” can be written:

[source,javascript]
----
Expand Down
4 changes: 2 additions & 2 deletions 03_functions.txt
Expand Up @@ -244,7 +244,7 @@ passing around function values to other functions.

== Declaration notation ==

There is a slightly shorter way to say “++var x = function…++”. The
There is a slightly shorter way to say “`var x = function…`”. The
`function` keyword can also be used at the start of a statement, to
produce a function declaration statement.

Expand Down Expand Up @@ -641,7 +641,7 @@ find(1, "1")
The indentation suggests the depth of the call stack. The first call
to `find` itself calls `find` twice, to explore the solutions that
start with `(1 + 5)` and `(1 * 3)`. The first call fails to find a
solution that starts with ++(1 + 5)++—using recursion, it explores
solution that starts with `(1 + 5)`—using recursion, it explores
_all_ such solutions that yield a number smaller than the goal number.
Thus, it returns `null`, and the “||” operator causes the call that
explores `(1 * 3)` to happen. This one has more luck, its first
Expand Down
2 changes: 1 addition & 1 deletion 06_object.txt
Expand Up @@ -74,7 +74,7 @@ object it was called on. For example, if there are different rabbits,
the `speak` method must indicate which rabbit is speaking.

When a function is called as a method—looked up as a property and
immediately called, as in ++object.method()++—the special variable
immediately called, as in `object.method()`—the special variable
`this` in its body will point to the object that it was called on.

// test: join
Expand Down
4 changes: 2 additions & 2 deletions 07_elife.txt
Expand Up @@ -232,7 +232,7 @@ BouncingCritter.prototype.act = function(view) {
};
----

The “++|| s++” part is there to prevent `this.direction` from getting
The “`|| s`” part is there to prevent `this.direction` from getting
the value null when the critter is somehow trapped with no empty space
around it (for example when crowded in a corner by other critters).

Expand Down Expand Up @@ -670,7 +670,7 @@ is East.
The function first looks up the index of the given direction in the
`directionNames` array, then offsets it, takes the remainder of the
result and 8, and then fetches the corresponding name from the array
again. The extra “+++ 8++” is there because the ‘%’ operator, when
again. The extra “`+ 8`” is there because the ‘%’ operator, when
given a negative number on the left hand side, will return a negative
result. So we add another eight to make sure the sum is positive,
under the requirement that the `n` argument is never less than -8.
Expand Down
3 changes: 3 additions & 0 deletions asciidoc_db.conf
Expand Up @@ -12,6 +12,9 @@ leveloffset=1
!!html (?P<text>[^!]*)!!=htmlonly
!!tex (?P<text>[^!]*)!!=texonly

[quotes]
`=#monospaced

[indexsee-inlinemacro]
<indexterm>
<primary>{1}</primary>
Expand Down
3 changes: 3 additions & 0 deletions asciidoc_html.conf
Expand Up @@ -13,6 +13,9 @@ rsquo=’
ldquo=“
rdquo=”

[quotes]
`=#monospaced

[macros]
(?su)(?<!\w)indexsee:\[(?P<attrlist>[^\]]*?)\]=indexsee
!!html (?P<text>[^!]*)!!=htmlonly
Expand Down

0 comments on commit f0268c4

Please sign in to comment.