Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ name: Lint
on:
pull_request:

permissions:
contents: read

jobs:
file-ref-check:
name: file-ref-check
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ name: Vale
on:
pull_request:

permissions:
contents: read

jobs:
vale:
name: runner / vale
Expand Down
17 changes: 13 additions & 4 deletions common/src/components/flanksource/Navigation.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@ import React, { useState, useRef } from 'react';
import { FaChevronDown, FaChevronUp, FaBars, FaTimes, FaBullseye, FaSearch, FaDatabase, FaExclamationTriangle, FaRocket, FaTools, FaLifeRing, FaSync, FaLightbulb, FaEye, FaRobot } from 'react-icons/fa';
import { SiPostgresql } from 'react-icons/si';

const isGitHubUrl = (href) => {
try {
const url = new URL(href);
return url.protocol === 'https:' && url.hostname === 'github.com';
} catch {
return false;
}
};

const Navigation = ({
logo = <img src="/img/mission-control-logo.svg" />,
loginButton = { href: "https://app.flanksource.com/", text: "Login" },
Expand Down Expand Up @@ -241,8 +250,8 @@ const Navigation = ({
key={index}
href={product.href}
className="flex items-start p-1 rounded-lg hover:bg-gray-50 transition-colors"
target={product.href.includes('github.com') ? '_blank' : '_self'}
rel={product.href.includes('github.com') ? 'noopener noreferrer' : ''}
target={isGitHubUrl(product.href) ? '_blank' : '_self'}
rel={isGitHubUrl(product.href) ? 'noopener noreferrer' : ''}
>
<div className="mr-2 mt-1">{product.icon}</div>
<div>
Expand Down Expand Up @@ -451,8 +460,8 @@ const Navigation = ({
key={index}
href={product.href}
className="flex items-start p-3 rounded-lg hover:bg-gray-50 transition-colors"
target={product.href.includes('github.com') ? '_blank' : '_self'}
rel={product.href.includes('github.com') ? 'noopener noreferrer' : ''}
target={isGitHubUrl(product.href) ? '_blank' : '_self'}
rel={isGitHubUrl(product.href) ? 'noopener noreferrer' : ''}
>
<div className="mr-3 mt-1">{product.icon}</div>
<div>
Expand Down
3 changes: 2 additions & 1 deletion common/src/theme/prism-jq.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
(function (Prism) {

var interpolation = /\\\((?:[^()]|\([^()]*\))*\)/.source;
var string = RegExp(/(^|[^\\])"(?:[^"\r\n\\]|\\[^\r\n(]|__)*"/.source.replace(/__/g, function () { return interpolation; }));
// Keep the string matcher linear-time; interpolation highlighting is handled below.
var string = /(^|[^\\])"(?:[^"\r\n\\]|\\[^\r\n])*"/;
var stringInterpolation = {
'interpolation': {
pattern: RegExp(/((?:^|[^\\])(?:\\{2})*)/.source + interpolation),
Expand Down
Loading