-
Notifications
You must be signed in to change notification settings - Fork 21.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Formats code blocks for better syntax highlighting [ci skip] #40079
Formats code blocks for better syntax highlighting [ci skip] #40079
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few of these don't quite fit, but most are great! 👍
@@ -461,7 +461,7 @@ Database Views | |||
|
|||
Imagine you need to work with a legacy database containing the following table: | |||
|
|||
``` | |||
```sql |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if this really benefits from highlighting...?
@@ -678,7 +678,7 @@ SELECT viewable_by, locked FROM clients | |||
|
|||
Be careful because this also means you're initializing a model object with only the fields that you've selected. If you attempt to access a field that is not in the initialized record you'll receive: | |||
|
|||
``` | |||
```ruby |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is technically not Ruby.
@@ -1236,13 +1236,13 @@ The code evaluating `Hotel::Image` needs to make sure | |||
|
|||
In these cases the interpreter issues a warning though: | |||
|
|||
``` | |||
```ruby |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not really Ruby.
warning: toplevel constant Image referenced by Hotel::Image | ||
``` | ||
|
||
This surprising constant resolution can be observed with any qualifying class: | ||
|
||
``` | ||
```ruby |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because of the mixed content, I think the highlighting here detracts more than it adds.
@@ -208,7 +208,7 @@ Adding extra logging like this makes it easy to search for unexpected or unusual | |||
|
|||
When looking at database query output in logs, it may not be immediately clear why multiple database queries are triggered when a single method is called: | |||
|
|||
``` | |||
```ruby |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because of the mixed content, I think the highlighting here detracts more than it adds.
@@ -219,7 +219,7 @@ irb(main):001:0> Article.pamplemousse | |||
|
|||
After running `ActiveRecord::Base.verbose_query_logs = true` in the `bin/rails console` session to enable verbose query logs and running the method again, it becomes obvious what single line of code is generating all these discrete database calls: | |||
|
|||
``` | |||
```ruby |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because of the mixed content, I think the highlighting here detracts more than it adds.
guides/source/security.md
Outdated
@@ -666,7 +666,7 @@ Project.where("name = '#{params[:name]}'") | |||
|
|||
And now let's inject another query using the UNION statement: | |||
|
|||
``` | |||
```sql |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This technically isn't valid SQL by itself, so the highlighting doesn't really work here.
guides/source/security.md
Outdated
@@ -734,7 +734,7 @@ This JavaScript code will simply display an alert box. The next examples do exac | |||
|
|||
These examples don't do any harm so far, so let's see how an attacker can steal the user's cookie (and thus hijack the user's session). In JavaScript you can use the `document.cookie` property to read and write the document's cookie. JavaScript enforces the same origin policy, that means a script from one domain cannot access cookies of another domain. The `document.cookie` property holds the cookie of the originating web server. However, you can read and write this property, if you embed the code directly in the HTML document (as it happens with XSS). Inject this anywhere in your web application to see your own cookie on the result page: | |||
|
|||
``` | |||
```js |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
```js | |
```html |
railties/CHANGELOG.md
Outdated
@@ -4,7 +4,7 @@ | |||
|
|||
Usage: | |||
|
|||
``` | |||
```bash | |||
rails generate scaffold Pet name:string --database=animals |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rails generate scaffold Pet name:string --database=animals | |
$ bin/rails generate scaffold Pet name:string --database=animals |
railties/CHANGELOG.md
Outdated
@@ -27,7 +27,7 @@ | |||
|
|||
If you already have an abstract class and it follows a different pattern than Rails defaults, you can pass a parent class with the database argument. | |||
|
|||
``` | |||
```bash | |||
rails generate scaffold Pet name:string --database=animals --parent=SecondaryBase |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rails generate scaffold Pet name:string --database=animals --parent=SecondaryBase | |
$ bin/rails generate scaffold Pet name:string --database=animals --parent=SecondaryBase |
2961a5c
to
0302497
Compare
0302497
to
84d6a0e
Compare
@jonathanhefner Thanks for the review. I have made the suggested changes. |
Thank you @chiraggshah! |
Summary
The PR adds various languages to the fenced code blocks for better syntax highlighting