Skip to content

bubkoo/hexo-filter-fenced-code

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
lib
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

hexo-filter-fenced-code

MIT License

npm: Package Quality

Extend syntax for the native fenced code block.

Feature:

  • Extend syntax for the native fenced code block.
  • Use tag-plugins as fenced code block.

Markdown Extra Syntax

The Native Fenced Code Block

```javascript
var foo = "bar";
```

Highlight and Insert Code

```javascript+
var foo = "bar";
```

or

````javascript
var foo = "bar";
````

The code will be inserted as a script block:

<script>
var foo = "bar";
</script>

Just Insert Code

```javascript-
var foo = "bar";
```

or

`````javascript
var foo = "bar";
`````

Note: Only JavaScript, CSS and HTML code can be inserted into a post. This feature is handily for building a quick demo.

Tag Plugins' Syntax Sugar

The native tag plugin looks like this:

  • block

    {% tagname [option1] [option2] ... %}
    content
    {% endblockquote %}
  • inline

    {% tagname [option1] [option2] ... %}

Use the syntax sugar as follow:

  • block

      ```tagname [option1] [option2] ... 
      content
      ```
    
  • inline

      ```tagname [option1] [option2] ...
      ```
    

Related

Contributing

Pull requests and stars are highly welcome.

For bugs and feature requests, please create an issue.

About

🎨 Extend syntax for the native fenced code block.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published