Skip to content

Commit

Permalink
Use a plugin to calculate word count correctly
Browse files Browse the repository at this point in the history
Code taken from iBug. jekyll/jekyll#7813
  • Loading branch information
weirane committed Jan 1, 2020
1 parent a02ca0d commit 45d52b6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
8 changes: 8 additions & 0 deletions _plugins/number_of_words.rb
@@ -0,0 +1,8 @@
module Jekyll
module Filters
def number_of_words input
cjk_regex = %r!\p{Han}|\p{Katakana}|\p{Hiragana}|\p{Hangul}!
input.scan(cjk_regex).length + input.gsub(cjk_regex, ' ').split.length
end
end
end
1 change: 0 additions & 1 deletion _posts/2019-11-25-rust-wasm-closest-pair.md
Expand Up @@ -2,7 +2,6 @@
title: "Rust + WebAssembly: 最近点对问题"
description: A Rust + WebAssembly demo of the closest point problem
toc: true
read_time: false
category: Programming
tags: rust wasm
redirect_from: /r/2
Expand Down

0 comments on commit 45d52b6

Please sign in to comment.