Skip to content

Commit 2a3bc04

Browse files
committed
fixed processing of UTF-8 with BOM encoded source files
1 parent 3d901dc commit 2a3bc04

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11

2+
## 1.3.1
3+
4+
- fixed processing of UTF-8 with BOM encoded source files
5+
26
## 1.3.0
37

48
- added support for multiline comment starting with `/**`

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "doxyjs",
3-
"version": "1.3.0",
3+
"version": "1.3.1",
44
"description": "Converts Javascript into psudo C++ for Doxygen",
55
"main": "index.js",
66
"author": "Dmitry Toropchin",

src/doxyjs.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ import inputStructure from './inputStructure';
33
import outputSource from './outputSource';
44

55
const doxyjs = (input_data, linebreak, ts) => {
6-
const input_lines = input_data.split(linebreak).filter((line) => line.length);
6+
const input_str = input_data.charCodeAt(0) === 0xFEFF ? input_data.slice(1) : input_data;
7+
const input_lines = input_str.split(linebreak).filter((line) => line.length);
78
const input_tokens = inputTokens(input_lines);
89
const input_structure = inputStructure(input_tokens);
910
const output_source = outputSource(input_structure, linebreak, ts);

0 commit comments

Comments
 (0)