git.s-ol.nu mmm / a5fc2c9
support facet attribute in <mmm-link> s-ol 4 months ago
1 changed file(s) with 2 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
8686 (html, fileder) =>
8787 html = html\yieldable_gsub '<mmm%-link%s+(.-)>(.-)</mmm%-link>', (attrs, text) ->
8888 text = nil if #text == 0
89 path = ''
89 path, facet = '', ''
9090 while attrs and attrs != ''
9191 key, val, _attrs = attrs\match '^(%w+)="([^"]-)"%s*(.*)'
9292 if not key
9797
9898 switch key
9999 when 'path' then path = val
100 when 'facet' then facet = val
100101 else warn "unkown attribute '#{key}=\"#{val}\"' in <mmm-link>"
101102
102103 link_to path, text, fileder