# The Greeter class
class Greeter
  def initialize(name)
    @name = name.capitalize
  end

  def salute
    puts "Hello #{@name}!"
  end
end

g = Greeter.new("world")
g.salute

language: ...

style: atom-one-light

Get version 9.13.1

Usage

Contribute

@highlightjs

News

  1. Version 9.13.1

    Improvements:

    • C# function declarations no longer include trailing whitespace, by JeremyTCD
    • Added new and missing keywords to AngelScript, by Melissa Geels
    • TypeScript decorator factories highlighting fix, by Antoine Boisier-Michaud
    • Added support for multiline strings to Swift, by Alejandro Isaza
    • Fixed issue that was causing some minifiers to fail.
    • Fixed autoDetection to accept language aliases.
  2. Version 9.13.0

    New languages:

    New styles:

    Improvements:

  3. Version 9.12.0

    New language:

    New style:

    Improvements:

    • Crystal updated with new keywords and syntaxes by Tsuyusato Kitsune.
    • Julia updated to the modern definitions by Alex Arslan.
    • julia-repl added by Morten Piibeleht.
    • Stanislav Belov wrote a new definition for 1C, replacing the one that has not been updated for more than 8 years. The new version supports syntax for versions 7.7 and 8.
    • Nicolas LLOBERA improved C# definition fixing edge cases with function titles detection and added highlighting of [Attributes].
    • nnnik provided a few correctness fixes for Autohotkey.
    • Martin Clausen made annotation collections in Clojure to look consistently with other kinds.
    • Alejandro Alonso updated Swift keywords.
  4. Version 9.11.0

    New languages:

    Improvements:

  5. Version 9.10.0

    Apologies for missing the previous release cycle. Some thing just can't be automated… Anyway, we're back!

    New languages:

    Improvements:

    • Rust got updated with new keywords by Kasper Andersen and then significantly modernized even more by Eduard-Mihai Burtescu (yes, @eddyb, Rust core team member!)
    • Python updated with f-literals by Philipp A.
    • YAML updated with unquoted strings support.
    • Gauss updated with new keywords by Matt Evans.
    • Lua updated with new keywords by Joe Blow.
    • Kotlin updated with new keywords by Philipp Hauer.
    • TypeScript got highlighting of function params and updated keywords by Ike Ku.
    • Scheme now correctly handles `-quoted lists thanks to Guannan Wei.
    • Sam Wu fixed handling of << in C++ defines.
  6. Version 9.9.0

    New languages

    Improvements:

    • TypeScript updated with annotations and param lists inside constructors, by Raphael Parree.
    • CoffeeScript updated with new keywords and fixed to recognize JavaScript in ```, thanks to thanks to Geoffrey Booth.
    • Compiler directives in Delphi are now correctly highlighted as "meta".
  7. Version 9.8.0 "New York"

    This version is the second one that deserved a name. Because I'm in New York, and the release isn't missing the deadline only because it's still Tuesday on West Coast.

    New languages:

    Improvements:

  8. Version 9.7.0

    A comprehensive bugfix release. This is one of the best things about highlight.js: even boring things keep getting better (even if slow).

    • VHDL updated with PSL keywords and uses more consistent styling.
    • Nested C-style comments no longer break highlighting in many languages.
    • JavaScript updated with => functions, highlighted object attributes and parsing within template string substitution blocks (${...}).
    • Fixed another corner case with self-closing <tag/> in JSX.
    • Added HEALTHCHECK directive in Docker.
    • Delphi updated with new Free Pascal keywords.
    • Fixed digit separator parsing in C++.
    • C# updated with new keywords and fixed to allow multiple identifiers within generics <...>.
    • Fixed another slow regex in Less.
  9. *** 10 years! ***

    Highlight.js turned 10 years a few days ago! Thanks for being with us :-)

  10. Version 9.6.0

    New languages:

    New styles:

    Plus, a few smaller updates for Lasso, Elixir, C++ and SQL.