Last active
November 12, 2017 05:41
-
-
Save ArvinH/e3bbd62fcf22f8d00c88610adaf6c888 to your computer and use it in GitHub Desktop.
Regex for solving order problem
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/components/github-htmlview.component.js b/src/components/github-htmlview.component.js | |
index 1d50925..83e04d3 100644 | |
--- a/src/components/github-htmlview.component.js | |
+++ b/src/components/github-htmlview.component.js | |
@@ -204,8 +204,10 @@ export class GithubHtmlView extends Component { | |
/<span class="email-hidden-toggle"><a href="#">…<\/a><\/span>/g, | |
'' | |
) | |
- .replace(/<\/summary>/g, '</summary><hidden>') | |
+ .replace(/<details>/g, '<details><hidden>') | |
.replace(/<\/details>/g, '</hidden></details>') | |
+ .replace(/(<details>)(<hidden>(.|\n|\r)*)(<summary>(.|\n|\r)*<\/summary>)((.|\n|\r)*)(<\/hidden><\/details>)/g, | |
+ '$1$4$2$6$8') | |
// Remove links & spans around images | |
.replace(/<a[^>]+><img([^>]+)><\/a>/g, '<img$1>') | |
.replace(/<span[^>]*><img([^>]+)><\/span>/g, '<img$1>') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment