HyphenationRule extends BaseRule

Rule for matching and fixing hyphenated lines

(defined in /src/rules/HyphenationRule.coffee:7)
class HyphenationRule extends BaseRule

Parameters

(None)
(defined in /src/rules/HyphenationRule.coffee:22)
fix : (c) ->
	# remember line/page separator
	oldSep = c.next('char')
	c.sub(c.cur('bword')).with(
		c.cur('bword').clone()   # clone the current word
			.removeRight(1)        # remove the '-'/'='
			.join(c.next('bword')) # join the next word
	)
	# Delete the next word
	c.del c.next('bword')
(defined in /src/rules/HyphenationRule.coffee:14)
match : (c) ->
	c.cur('char').match("-|=") and
	c.next('char').match("\\n|\\f") and
	c.cur('bword') and c.cur('bword').length > 1