Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: wooorm/refractor
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 4.8.1
Choose a base ref
...
head repository: wooorm/refractor
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 4.9.0
Choose a head ref
  • 18 commits
  • 320 files changed
  • 1 contributor

Commits on Mar 11, 2025

  1. Update dev-dependencies

    wooorm committed Mar 11, 2025

    Verified

    This commit was signed with the committer’s verified signature. The key has expired.
    yinzara Matthew Vance
    Copy the full SHA
    a34f125 View commit details
  2. Add .tsbuildinfo to .gitignore

    wooorm committed Mar 11, 2025

    Verified

    This commit was signed with the committer’s verified signature. The key has expired.
    yinzara Matthew Vance
    Copy the full SHA
    7de8165 View commit details
  3. Update actions

    wooorm committed Mar 11, 2025
    Copy the full SHA
    3500120 View commit details
  4. Refactor .editorconfig

    wooorm committed Mar 11, 2025
    Copy the full SHA
    8b2c6fa View commit details
  5. Refactor .prettierignore

    wooorm committed Mar 11, 2025
    Copy the full SHA
    dd5711e View commit details
  6. Remove license year

    wooorm committed Mar 11, 2025
    Copy the full SHA
    35fbc5b View commit details
  7. Add .npmrc

    wooorm committed Mar 11, 2025
    Copy the full SHA
    8167130 View commit details
  8. Refactor package.json

    wooorm committed Mar 11, 2025
    Copy the full SHA
    ca299cd View commit details
  9. Refactor tsconfig.json

    wooorm committed Mar 11, 2025
    Copy the full SHA
    44ca20e View commit details
  10. Update Prism to 1.30.0

    wooorm committed Mar 11, 2025
    Copy the full SHA
    e9eef44 View commit details
  11. Refactor code-style

    wooorm committed Mar 11, 2025
    Copy the full SHA
    7f9d266 View commit details
  12. Refactor docs

    wooorm committed Mar 11, 2025
    Copy the full SHA
    55f1e51 View commit details
  13. Copy the full SHA
    58626cf View commit details
  14. Add declaration maps

    wooorm committed Mar 11, 2025
    Copy the full SHA
    2398b37 View commit details
  15. Update example

    wooorm committed Mar 11, 2025
    Copy the full SHA
    fc39055 View commit details
  16. Fix license to include author

    This is related to 3e09ea1 (GH-58, GH-61),
    which inlined some code,
    which should have also changed the license.
    wooorm committed Mar 11, 2025
    Copy the full SHA
    469ba8a View commit details
  17. Refactor docs

    wooorm committed Mar 11, 2025
    Copy the full SHA
    94b78fe View commit details
  18. 4.9.0

    wooorm committed Mar 11, 2025
    Copy the full SHA
    5fb62fa View commit details
Showing 320 changed files with 3,243 additions and 2,042 deletions.
8 changes: 4 additions & 4 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
end_of_line = lf
indent_size = 2
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true
14 changes: 7 additions & 7 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
name: main
on:
- pull_request
- push
jobs:
main:
name: ${{matrix.node}}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{matrix.node}}
- run: npm install
- run: npm test
- uses: codecov/codecov-action@v1
- uses: codecov/codecov-action@v5
strategy:
matrix:
node:
- lts/hydrogen
- node
name: main
on:
- pull_request
- push
6 changes: 4 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
coverage/
node_modules/
*.d.ts
*.log
*.map
*.tsbuildinfo
.DS_Store
coverage/
node_modules/
package-lock.json
yarn.lock
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ignore-scripts=true
5 changes: 2 additions & 3 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
*.html
*.md
coverage/
refractor.js
refractor.min.js
*.html
*.json
*.md
19 changes: 12 additions & 7 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
// To do: Old export names, remove next major.
/**
* Old export names, remove next major.
* @typedef {import('./lib/core.js').RefractorRoot} RefractorRoot
* @typedef {import('./lib/core.js').RefractorElement} RefractorElement
* @typedef {import('./lib/core.js').Text} Text
*
* Old and new names:
* @typedef {import('./lib/core.js').Grammar} Grammar
* @typedef {import('hast').Text} Text
*/

// Old and new names:
/**
* @typedef {import('prismjs').Grammar} Grammar
* @typedef {import('./lib/core.js').Syntax} Syntax
*
* New names:
*/

// New names:
/**
* @typedef {import('./lib/core.js').RefractorRoot} Root
*/

export {refractor} from './lib/common.js'
5 changes: 4 additions & 1 deletion lang/abap.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion lang/abnf.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
// @ts-nocheck
/**
* @import {Syntax} from '../core.js'
*/
abnf.displayName = 'abnf'
abnf.aliases = []

/** @type {import('../core.js').Syntax} */
/** @type {Syntax} */
export default function abnf(Prism) {
;(function (Prism) {
var coreRules =
5 changes: 4 additions & 1 deletion lang/actionscript.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
// @ts-nocheck
/**
* @import {Syntax} from '../core.js'
*/
import refractorJavascript from './javascript.js'
actionscript.displayName = 'actionscript'
actionscript.aliases = []

/** @type {import('../core.js').Syntax} */
/** @type {Syntax} */
export default function actionscript(Prism) {
Prism.register(refractorJavascript)
Prism.languages.actionscript = Prism.languages.extend('javascript', {
5 changes: 4 additions & 1 deletion lang/ada.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
// @ts-nocheck
/**
* @import {Syntax} from '../core.js'
*/
ada.displayName = 'ada'
ada.aliases = []

/** @type {import('../core.js').Syntax} */
/** @type {Syntax} */
export default function ada(Prism) {
Prism.languages.ada = {
comment: /--.*/,
5 changes: 4 additions & 1 deletion lang/agda.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
// @ts-nocheck
/**
* @import {Syntax} from '../core.js'
*/
agda.displayName = 'agda'
agda.aliases = []

/** @type {import('../core.js').Syntax} */
/** @type {Syntax} */
export default function agda(Prism) {
;(function (Prism) {
Prism.languages.agda = {
5 changes: 4 additions & 1 deletion lang/al.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
// @ts-nocheck
/**
* @import {Syntax} from '../core.js'
*/
al.displayName = 'al'
al.aliases = []

/** @type {import('../core.js').Syntax} */
/** @type {Syntax} */
export default function al(Prism) {
// based on https://github.com/microsoft/AL/blob/master/grammar/alsyntax.tmlanguage

5 changes: 4 additions & 1 deletion lang/antlr4.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
// @ts-nocheck
/**
* @import {Syntax} from '../core.js'
*/
antlr4.displayName = 'antlr4'
antlr4.aliases = ['g4']

/** @type {import('../core.js').Syntax} */
/** @type {Syntax} */
export default function antlr4(Prism) {
Prism.languages.antlr4 = {
comment: /\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,
5 changes: 4 additions & 1 deletion lang/apacheconf.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion lang/apex.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
// @ts-nocheck
/**
* @import {Syntax} from '../core.js'
*/
import refractorClike from './clike.js'
import refractorSql from './sql.js'
apex.displayName = 'apex'
apex.aliases = []

/** @type {import('../core.js').Syntax} */
/** @type {Syntax} */
export default function apex(Prism) {
Prism.register(refractorClike)
Prism.register(refractorSql)
8 changes: 6 additions & 2 deletions lang/apl.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
// @ts-nocheck
/**
* @import {Syntax} from '../core.js'
*/
apl.displayName = 'apl'
apl.aliases = []

/** @type {import('../core.js').Syntax} */
/** @type {Syntax} */
export default function apl(Prism) {
Prism.languages.apl = {
comment: /(?:|#[! ]).*$/m,
@@ -18,7 +21,8 @@ export default function apl(Prism) {
alias: 'function'
},
constant: /[#]/,
function: /[-+×÷|?*!<=>~,¤]/,
function:
/[-+×÷|?*!<=>~,¤]/,
'monadic-operator': {
pattern: /[\\\/¨&]/,
alias: 'operator'
5 changes: 4 additions & 1 deletion lang/applescript.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
// @ts-nocheck
/**
* @import {Syntax} from '../core.js'
*/
applescript.displayName = 'applescript'
applescript.aliases = []

/** @type {import('../core.js').Syntax} */
/** @type {Syntax} */
export default function applescript(Prism) {
Prism.languages.applescript = {
comment: [
5 changes: 4 additions & 1 deletion lang/aql.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
// @ts-nocheck
/**
* @import {Syntax} from '../core.js'
*/
aql.displayName = 'aql'
aql.aliases = []

/** @type {import('../core.js').Syntax} */
/** @type {Syntax} */
export default function aql(Prism) {
Prism.languages.aql = {
comment: /\/\/.*|\/\*[\s\S]*?\*\//,
5 changes: 4 additions & 1 deletion lang/arduino.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion lang/arff.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
// @ts-nocheck
/**
* @import {Syntax} from '../core.js'
*/
arff.displayName = 'arff'
arff.aliases = []

/** @type {import('../core.js').Syntax} */
/** @type {Syntax} */
export default function arff(Prism) {
Prism.languages.arff = {
comment: /%.*/,
5 changes: 4 additions & 1 deletion lang/armasm.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
// @ts-nocheck
/**
* @import {Syntax} from '../core.js'
*/
armasm.displayName = 'armasm'
armasm.aliases = ['arm-asm']

/** @type {import('../core.js').Syntax} */
/** @type {Syntax} */
export default function armasm(Prism) {
Prism.languages.armasm = {
comment: {
5 changes: 4 additions & 1 deletion lang/arturo.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
// @ts-nocheck
/**
* @import {Syntax} from '../core.js'
*/
arturo.displayName = 'arturo'
arturo.aliases = ['art']

/** @type {import('../core.js').Syntax} */
/** @type {Syntax} */
export default function arturo(Prism) {
;(function (Prism) {
/**
11 changes: 4 additions & 7 deletions lang/asciidoc.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
// @ts-nocheck
/**
* @import {Syntax} from '../core.js'
*/
asciidoc.displayName = 'asciidoc'
asciidoc.aliases = ['adoc']

/** @type {import('../core.js').Syntax} */
/** @type {Syntax} */
export default function asciidoc(Prism) {
;(function (Prism) {
var attributes = {
@@ -23,7 +26,6 @@ export default function asciidoc(Prism) {
// See rest below
}
},

string: /"(?:[^"\\]|\\.)*"/,
variable: /\w+(?==)/,
punctuation: /^\[|\]$|,/,
@@ -52,15 +54,13 @@ export default function asciidoc(Prism) {
// See rest below
}
},

'passthrough-block': {
pattern: /^(\+{4,})$[\s\S]*?^\1$/m,
inside: {
punctuation: /^\++|\++$/
// See rest below
}
},

// Literal blocks and listing blocks
'literal-block': {
pattern: /^(-{4,}|\.{4,})$[\s\S]*?^\1$/m,
@@ -69,7 +69,6 @@ export default function asciidoc(Prism) {
// See rest below
}
},

// Sidebar blocks, quote blocks, example blocks and open blocks
'other-block': {
pattern: /^(--|\*{4,}|_{4,}|={4,})$[\s\S]*?^\1$/m,
@@ -78,7 +77,6 @@ export default function asciidoc(Prism) {
// See rest below
}
},

// list-punctuation and list-label must appear before indented-block
'list-punctuation': {
pattern:
@@ -105,7 +103,6 @@ export default function asciidoc(Prism) {
// See rest below
}
},

'attribute-entry': {
pattern: /^:[^:\r\n]+:(?: .*?(?: \+(?:\r?\n|\r).*?)*)?$/m,
alias: 'tag'
5 changes: 4 additions & 1 deletion lang/asm6502.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
// @ts-nocheck
/**
* @import {Syntax} from '../core.js'
*/
asm6502.displayName = 'asm6502'
asm6502.aliases = []

/** @type {import('../core.js').Syntax} */
/** @type {Syntax} */
export default function asm6502(Prism) {
Prism.languages.asm6502 = {
comment: /;.*/,
Loading