Add support for Wikipedia Emoji Templates: EMOWIKI
diff --git a/test/test.js b/test/test.js
index 4f18d56..a6be349 100644
--- a/test/test.js
+++ b/test/test.js
@@ -40,4 +40,26 @@
expect(lines_count).toBe(6202);
done();
});
+ test('Regression test for issue #114: Wikipedia emoji templates', (done) => {
+ // Test that Wikipedia emoji templates are recognized as EMOWIKI tokens
+ const testInput = `# foundry = base
+# text_id = test-114
+# text = [_EMOJI:{{S|;)}}_] and [_EMOJI:{{cool}}_]
+1 [_EMOJI:{{S|;)}}_] _ _ _ _ _ _ _ _
+2 and _ CCONJ _ _ _ _ _ _
+3 [_EMOJI:{{cool}}_] _ _ _ _ _ _ _ _
+
+`;
+ const { execSync } = require('child_process');
+ const stdout = execSync('node src/index.js', { input: testInput }).toString();
+
+ // Check that Wikipedia emoji templates are tagged as EMOWIKI
+ expect(stdout).toContain('[_EMOJI:{{S|;)}}_]\t_\tEMOWIKI\tEMOWIKI');
+ expect(stdout).toContain('[_EMOJI:{{cool}}_]\t_\tEMOWIKI\tEMOWIKI');
+
+ // Count EMOWIKI occurrences (should be 2 for each template - columns 3 and 4)
+ var emowiki_count = (stdout.match(/EMOWIKI/g) || []).length;
+ expect(emowiki_count).toBe(4); // 2 templates × 2 columns = 4
+ done();
+ });
});