The reason the ACE editor was failing to load the rust syntax highlighting is because the syntax highlighting was being created *after* the editor was created. If the editor is created first, then ACE tries to load `ace/mode/rust`. Since it isn't already defined, it tried to compute the URL and load it manually. However, since the URLs now have a hash in it (via https://github.com/rust-lang/mdBook/pull/1368), it was unable to load. The solution here is to make sure `ace/mode/rust` is defined before creating the editors. Then ACE knows that it can just load the module directly instead of trying to fetch it from the server. Fixes https://github.com/rust-lang/mdBook/issues/2700
36 lines
1.1 KiB
Text
36 lines
1.1 KiB
Text
// This tests pressing the left and right arrows moving to previous and next page.
|
|
|
|
go-to: |DOC_PATH| + "index.html"
|
|
|
|
// default page is the first numbered page
|
|
assert-text: ("title", "Introduction - mdBook test book")
|
|
|
|
// Moving left we get to the prefix page
|
|
press-key: 'ArrowLeft'
|
|
assert-text: ("title", "Prefix Chapter - mdBook test book")
|
|
|
|
// Trying to move to the left beyond the prefix pages - nothing changes
|
|
press-key: 'ArrowLeft'
|
|
assert-text: ("title", "Prefix Chapter - mdBook test book")
|
|
|
|
// Back to the main page
|
|
press-key: 'ArrowRight'
|
|
assert-text: ("title", "Introduction - mdBook test book")
|
|
|
|
press-key: 'ArrowRight'
|
|
assert-text: ("title", "Markdown Individual tags - mdBook test book")
|
|
|
|
press-key: 'ArrowRight'
|
|
assert-text: ("title", "Heading - mdBook test book")
|
|
|
|
// Last numbered page
|
|
go-to: "../rust/rust_codeblock.html"
|
|
assert-text: ("title", "Rust Codeblocks - mdBook test book")
|
|
|
|
// Go to the suffix chapter
|
|
press-key: 'ArrowRight'
|
|
assert-text: ("title", "Suffix Chapter - mdBook test book")
|
|
|
|
// Try to go beyond the last page
|
|
press-key: 'ArrowRight'
|
|
assert-text: ("title", "Suffix Chapter - mdBook test book")
|