@requires_authorization
def somefunc(param1='', param2=0):
    r'''A docstring'''
    if param1 > param2: # interesting
        print 'Gre\'ater'
    return (param2 - param1 + 1 + 0b10l) or None

class SomeClass:
    pass

>>> message = '''interpreter
... prompt'''

language: ...

style: vs

Get version 9.17.1

Usage

Contribute

@highlightjs

News

  1. Version 9.17.1

    Fixes:

    • fix(parser): resolve IE 11 issue with Object.freeze() (#2319) [Josh Goebel][]
  2. Version 9.17.0

    New languages:

    • none.

    New themes:

    Core Improvements:

    • chore(parser): switch from createElementNS to createElement (#2314) Josh Goebel
    • enh(parser): add better error when a language requirement is missing (#2311) Josh Goebel
    • fix(parser/docs): disallow self mode at the top-level of a language (#2294) Josh Goebel
    • enh(parser) add safe & debug modes. Better error handling for crash conditions. (#2286) Josh Goebel
    • fix(parser): Fix merger HTML attribute quoting (#2235) Josh Goebel
    • fix(parser): Look-ahead regex now work for end matches also (#2237) Josh Goebel
    • fix(parser): Better errors when a language is missing (#2236) Josh Goebel
    • fix(parser): freeze built-in modes to prevent grammars altering them (#2271) Josh Goebel
    • fix(themes): fix inconsistencies between some themes padding/spacing (#2300) Josh Goebel
    • ehh(build) Add CI check for building a "use strict" safe rollup package from NPM builds (#2247) Josh Goebel
    • fix(pkg): Prefix global addEventListener with window to be able to minify with closure compiler (#2305) Kirill Saksin

    Language Improvements:

    • fix(sql): backslash is not used to escape in strings in standard SQL (#1748) Mike Schall
    • enh(ebnf) add backticks as additional string variant (#2290) Chris Marchesi
    • chore(javascript): add esm related extensions to aliases (#2298) Rongjian Zhang
    • fix(kotlin): fix termination of """ string literals (#2295) Josh Goebel
    • fix(mercury): don't change global STRING modes (#2271) Josh Goebel
    • enh(xml) expand and improve document type highlighting (#2287) w3suli
    • enh(ebnf) add underscore as allowed meta identifier character, and dot as terminator (#2281) Chris Marchesi
    • fix(makefile) fix double relevance for assigns, improves auto-detection (#2278) Josh Goebel
    • enh(xml) support for highlighting entities (#2260) w3suli
    • enh(gml) fix naming of keyword class (consistency fix) (#2254) Liam Nobel
    • enh(javascript): Add support for jsdoc comments (#2245) Milutin Kristofic
    • fix(python) fix if getting confused as an f-string (#2200) Josh Goebel and Carl Baxter
    • enh(powershell) major overhaul, huge improvements (#2224)
    • enh(css) Improve @rule highlighting, including properties (#2241) Josh Goebel
    • enh(css) Improve highlighting of numbers inside expr/func calc(2px+3px) (#2241)
    • enh(scss) Pull some of the CSS improvements back into SCSS (#2241)
    • fix(go): Fix escaped character literals (#2266) David Benjamin
    • fix(objectivec): Fix various preprocessor highlighting issues (#2265) David Benjamin
    • fix(objectivec): Handle multibyte character literals (#2268) David Benjamin
    • enh(cpp): Add additional keywords (#2289) Adrian Ostrowski
  3. Version 9.16.2

    New languages: none.

    New styles: none.

    Improvements: - fix(arduino) Resolves issue with arduino.js not being "use strict" safe

  4. Version 9.16.1

    New languages: none.

    New styles: - Night Owl by Carl Baxter

    Improvements: - Add CLI tool to quickly check for relevance conflicts Mark Ellis (#1554) - enhance(twig) update list of filter and tags (#2090) - fix(crystal): correctly highlight !~ method definition (#2222) - fix dropping characters if we choke up on a 0-width match (#2219) - (accesslog) improve accesslog relevancy scoring (#2172) - fix(shell): fix parsing of prompts with forward slash (#2218) - improve parser to properly support look-ahead regex in begin matchers (#2135) - blacklist super-common keywords from having relevance (#2179) - fix(swift): support for @dynamicMemberLookup and @propertyWrapper (#2202) - fix: endWithParent inside starts now always works (#2201) - fix(typescript): constructor in declaration doesn't break highlighting - fix(typescript): only match function keyword as a separate identifier (#2191) - feature(arduino) make arduino a super-set of cpp grammar - fix(javascript): fix object attributes immediately following line comments - fix(xml): remove vbscript as potential script tag subLanguage - fix(Elixir): improve regex for numbers - fix(YAML): improve matching for keys, blocks and numbers - fix(Pony): improve regex for numbers - fix(handlebars): add support for raw-blocks, and triple-mustaches(#2175) - fix(handlebars): fix parsing of block-comments containing closing mustaches (#2175) - fix(handlebars): add support for segment-literal notation, and escaped mustaches (#2184) - JSON: support for comments in JSON (#2016) - fix(cpp): improve string literal matching - fix(highlight.js): omit empty span-tags in the output (#2182) - fix(Go): improve function declaration matching - fix(python): added support for f-string literal curly braces (#2195) - fix(cpp): add future built-in (#1610) - fix(python): support comments within function parameters (#2214)

  5. Version 9.15.10 New languages: none. New styles: none. Improvements: - support for ruby's squiggly heredoc (#2049) - support css custom properties (#2082) - fix(PureBASIC): update to 5.60 (#1508) - fix(Kotlin): parenthesized types in function declaration (#2107) - fix(Kotlin): nested comment (#2104) - fix(isbl): contains key typo (#2103) - fix(github-gist.css): match Github styles (#2100) - fix(elm): update to latest elm syntax (#2088) - fix: Support highlighting inline HTML and CSS tagged template strings in JS and TS (#2105) - feat(YAML): add YAML to common languages (#1952) - feat(xml): Add support for Windows Script File (.wsf), inline VBScript in XML script tags (#1690)

  6. Version 9.15.9

    Improvements: - fix(AutoHotkey): order and extended highlighting (#1579) - fix(Go): correctly highlight hex numbers, rather than stopping at last 'd' or 'f'. (#2060) - fix(Mathematica): Improvements to language (#2065) - fix(Node): Adds SCSS build (#2079) - fix(Rust): update keywords (#2052) - fix(Stata): Added keywords for the meta-analysis suite introduced in Stata 16 (#2081) - fix(Bash): escape double quotes (#2048)

  7. Version 9.15.8

    New languages: none. New styles: none. Improvements: - fix(bash): revert escaped double quotes - broke Firefox/Safari.

  8. Version 9.15.7 New languages: none. New styles: none. Improvements: - fix(powershell): Add cmdlets (#2022) - fix(Bash): escaped double quotes (#2041) - fix(c++): add aliases 'hh', 'hxx', 'cxx' (#2017) - fix(ini/toml): Support comments on the same line. (#2039) - fix(JSX): not rendering well in a function without parentheses. (#2024) - fix(LiveCode): language definition update (#2021) - fix(markdown): indented lists (#2004) - fix(styles/school-book): don't style all the pre, use .hljs instead (#2034) - fix(JSX): Modify JSX tag detection to use XML language regex in place of simplistic \w+

  9. Version 9.15.6 New languages: none. New styles: none. Improvements: - Move dependencies to be devDependencies. - Fixed security issues in dev dependencies.

  10. Version 9.15.5 New languages: none. New styles: none. Improvements: 🔥 Hot fix: updated build tool.