When writing publications and comments on the site, you can use HTML or Markdown to choose from. It is important to note that we support the "Habr Flavored Markdown", (abbreviated HFM) - it expands the traditional Markdown with several significant differences.

Yes, if you are not familiar with Markdown, it's worth taking a look at essentials of Markdown.

Differences from the traditional Markdown

Support for multiple underscores in words

Where Markdown transforms text framed by an underscore ( _ ), in italics, HFM ignores underlines:

  • wow_great_stuff
  • do_this_and_do_that_and_another_thing.

This allows you to write the source code that contains underscores in the names. To add italic, use asterisks (*).

AutoLink

HFM automatically converts URLs into active links. Exceptions are links within the code.

http://example.com
becomes

http://example.com

Strikethrough

HFM adds to the syntax support for strikethrough text, which is not in the traditional Markdown.

~~Mistaken text.~~
becomes

Mistaken text.

Code bloks

Traditional Markdown converts the text, which begins with 4 spaces on each line, into blocks of code. HFM also supports fenced code blocks. To do this, just wrap the `` ` code block - and there will be no need to begin each line with 4 spaces.


  ```
  function test() {
    console.log("notice the blank line before this function?");
  }
  ```
    
becomes

  function test() {
    console.log("notice the blank line before this function?");
  }
    

Syntax highlighting

To highlight the syntax, you can use blocks of code, supplemented by the name of the language. For example, to highlight the Ruby syntax:


  ```ruby
  require 'redcarpet'
  markdown = Redcarpet.new("Hello World!")
  puts markdown.to_html
  ```
    

We support the syntax of: C#, C++, CSS, Caché ObjectScript, Diff, HTML, XML, Java, Javascript, PHP, Perl, Python, Ruby, SQL, 1C, ActionScript, Apache, Axapta, CMake, CoffeeScript, DOS, Delphi, Django, Erlang, Erlang REPL, GLSL, Go, Haskell, Lisp, Lua, MEL, Markdown, Matlab, Nginx, Objective C, Rust, Scala, Smalltalk, TeX, VBScript, VHDL, Vala. The list will be gradually supplemented.


Tables

Tables can be created in one of two ways. Like this:


  First Header  | Second Header
  ------------- | -------------
  Content Cell  | Content Cell
  Content Cell  | Content Cell
    
First Header Second Header
Content Cell Content Cell
Content Cell Content Cell

Or by adding additional borders on the sides:


  | First Header  | Second Header |
  | ------------- | ------------- |
  | Content Cell  | Content Cell  |
  | Content Cell  | Content Cell  |
    
First Header Second Header
Content Cell Content Cell
Content Cell Content Cell

Note that the number of dashes in the header separator line and the number of characters in the table body may not match:


  | Name | Description |
  | ------------- | ----------- |
  | Help | Display the help window.|
  | Close | Closes a window |
    
Name Description
Help Display the help window.
Close Closes a window

In the cells of the table, you can use links, bold text, italic or strikethrough:


  | Name | Description |
  | ------------- | ----------- |
  | Help | ~~Display the~~ help window.|
  | Close | _Closes_ a window |
    
Name Description
Help Display the help window.
Close Closes a window

To use Markdown, do not forget to put a check mark: it is located directly above the tag field.