---
# System prepended metadata

title: Query 31

---

Syntax highlighting in Markdown is achieved using "fenced" code blocks and specifying the language of the code. This feature is not part of the original Markdown specification but has been introduced in many extended versions of Markdown, such as GitHub Flavored Markdown (GFM) [1].

Here's how you can achieve syntax highlighting:
1. Using Backticks (`): Start and end the code block with three backticks (```). Immediately after the opening backticks, you can specify the programming language. For example:
    ```
    ```python
    def hello_world():
    print("Hello, World!")
        ```
    ```
    When rendered (on platforms that support syntax highlighting, like GitHub), this code block will be highlighted with Python-specific syntax coloring.
    
2. Using Tildes (~): You can also use tildes to create fenced code blocks:
    ```markdown
    ~~~javascript
    function helloWorld() {
    console.log("Hello, World!");
    }
    ~~~
    ```
    Again, the syntax highlighting will be specific to the language (in this case, JavaScript) when rendered.
    
3. Supported Languages: The languages that are supported and the specific identifiers (like python, javascript, html, etc.) that you should use depend on the Markdown parser and the syntax highlighting library it uses. For instance, GitHub uses Linguist to provide language grammars and support syntax highlighting for many languages. If you're unsure, you can typically consult the documentation for your specific Markdown renderer or platform.

Note for Platforms without Syntax Highlighting:
If you're using a platform or tool that doesn't support syntax highlighting, specifying the language might have no effect. The code will still be displayed as a code block, but without the specific language-based coloring.
In general, using fenced code blocks with language specification is a good habit because it enhances readability when the platform supports syntax highlighting. If it doesn't, there's typically no harm done—the code will just appear in a monochrome block.