Closed cannikin closed 4 years ago
@cannikin I'm looking into it. Could this be related? https://github.com/redwoodjs/redwoodjs.com/commit/3cd4d98342c59f48b0518c2e9859b4879f2c8c53
That's my guess... I found the PR and added a link in the first comment. @Tobbe any idea if that would be causing this?
Yep, I reverted that commit locally and the sections are back. We definitely want this functionality though, we'll have to dig in and figure out what's blowing up that logic... it looks sound to me.
Maybe the tutorial has a syntax error where there's a missing ``` which would close a code block?
Oh geez the left nav is all over the place...I just did a deploy with a couple small text changes to the tutorial and now different sections are grouped together!
I'm going to revert that commit until we can figure that out...the tutorial working is our #1 priority!
Sorry for causing all the trouble. I'll see if I can figure out why it's breaking
No problem @Tobbe, it looked good to me too, I have no idea why it's freaking out! My guess is the tutorial itself has an extra something, or missing something, that's breaking it.
It's not the cause of this problem, but looking at the tutorial I found this
>
> ```javascript
> export const QUERY = gql`
> query BlogPostsQuery {
> postIds: posts {
> id
> }
> }
> `
> ```
>
> Now `postIds` will be available in `Success` instead of `posts`
That's something my regexp wouldn't handle since it expects code blocks to start at the start of the line (^
)
On the other hand, if that code block contained a #
it also wouldn't be detected as a heading to split a page at, so... don't worry about it?
Aha!
It's when you have a code block like this that it breaks
```plaintext{13-18}
// api/prisma/schema.prisma
model Post {
id Int @id @default(autoincrement())
title String
body String
createdAt DateTime @default(now())
}
```
My regexp doesn't handle the syntax for adding line highlights
Edit Haha I was typing this as your response came in, we found it at the same time!
Just had a thought as I was doing something else: that regex has a \w*
which won't match code blocks that have line number highlight hints:
```javascript{1,3}
But it will match the closing `` bracket. So I bet it's getting out of sync and counting some ``` as **opening** a code block, which then skips over the
##` headers in some parts of the tutorial.
What about just making the regexp look for lines that start with three backticks? Can you think of any false positives?
Yeah that should be fine, I'm pretty sure a line starting with those in markdown will always be code!
Cool, I'll make a new PR
I found two separate instances of sections getting merged together:
All got merged into Getting Dynamic.
All got merged into Saving Data
They all still have
##
levels as headers, andbuild.js
still says to break on heading levels[1, 2]
so nothing there has changed.@forresthayes @dom Do either of you remember a PR that tried to fix having
#
comments in code blocks (they were getting turned into section headers by mistake)? I'm wondering if that change caused this maybe? Update found the PR: https://github.com/redwoodjs/redwoodjs.com/pull/388