Prior copy tag cleanup (#38387)
This commit is contained in:
@@ -112,24 +112,24 @@ To ensure that all the line endings in your repository match your new configurat
|
||||
1. Before adding or committing any changes, verify that Git has applied the configuration correctly. For example, Git automatically determines whether files in a repository are text or binary files. To avoid corruption of binary files in your repository, we recommend that you explicitly mark files as binary in `.gitattributes`. For more information, see [gitattributes - Defining attributes per path](https://www.git-scm.com/docs/gitattributes#_marking_files_as_binary) in the Git documentation.
|
||||
1. To avoid losing any local changes to files in the repository, add and commit any outstanding changes by running the following commands.
|
||||
|
||||
```shell{:copy}
|
||||
```shell copy
|
||||
git add . -u
|
||||
git commit -m "Saving files before refreshing line endings"
|
||||
```
|
||||
1. To update all files on the current branch to reflect the new configuration, run the following commands.
|
||||
|
||||
```shell{:copy}
|
||||
```shell copy
|
||||
git rm -rf --cached .
|
||||
git reset --hard HEAD
|
||||
```
|
||||
1. To display the rewritten, normalized files, run the following command.
|
||||
|
||||
```shell{:copy}
|
||||
```shell copy
|
||||
git status
|
||||
```
|
||||
1. Optionally, to commit any outstanding changes in your repository, run the following command.
|
||||
|
||||
```shell{:copy}
|
||||
```shell copy
|
||||
git commit -m "Normalize all the line endings"
|
||||
```
|
||||
|
||||
|
||||
@@ -14,13 +14,8 @@ export default function parseInfoString() {
|
||||
visit(tree, matcher, (node) => {
|
||||
node.meta = strToObj(node.meta)
|
||||
|
||||
// Temporary, change {:copy} to ` copy` to avoid conflict in styles.
|
||||
// We may end up enabling copy on all code examples later.
|
||||
const copyTag = '{:copy}'
|
||||
if (node.lang.includes(copyTag)) {
|
||||
node.meta.copy = true
|
||||
node.lang = node.lang.replace(copyTag, '')
|
||||
}
|
||||
// Temporary, remove {:copy} to avoid highlight parse error in translations.
|
||||
node.lang = node.lang.replace('{:copy}', '')
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user