mirror of
https://github.com/pomber/git-history.git
synced 2024-11-22 14:02:24 +03:00
Fix tag highlighting
This commit is contained in:
parent
f5f28a6f24
commit
e0e4efa12a
@ -2,7 +2,7 @@ import React from "react";
|
||||
import animation from "./animation";
|
||||
import theme from "./nightOwl";
|
||||
|
||||
const themeStylesByType = {};
|
||||
const themeStylesByType = Object.create(null);
|
||||
theme.styles.forEach(({ types, style }) => {
|
||||
types.forEach(type => {
|
||||
themeStylesByType[type] = Object.assign(
|
||||
|
@ -19,14 +19,14 @@ function flattenTokens(tokens) {
|
||||
}
|
||||
|
||||
// Convert strings to tokens
|
||||
function tokenizeStrings(prismTokens) {
|
||||
function tokenizeStrings(prismTokens, parentType = "plain") {
|
||||
return prismTokens.map(pt =>
|
||||
typeof pt === "string"
|
||||
? { type: "plain", content: pt }
|
||||
? { type: parentType, content: pt }
|
||||
: {
|
||||
type: pt.type,
|
||||
content: Array.isArray(pt.content)
|
||||
? tokenizeStrings(pt.content)
|
||||
? tokenizeStrings(pt.content, pt.type)
|
||||
: pt.content
|
||||
}
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user