Skip to content

Commit

Permalink
add docx parser
Browse files Browse the repository at this point in the history
  • Loading branch information
Vytek committed Sep 3, 2023
1 parent c7f5772 commit 389f5a2
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion opencrucible.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
)

// Version exposes the current package version.
const Version = "0.0.1"
const Version = "0.0.2"

//Detects

Expand Down Expand Up @@ -51,3 +51,12 @@ func RTFParseToString(StreamToParse []byte) (string, error) {
rtf, err := cat.FromBytes(StreamToParse)
return rtf, err
}

func DOCXParseToString(StreamToParse []byte) (string, error) {
// If no StreamToDetect was given, return an error with a message.
if len(StreamToParse) == 0 {
return "", errors.New("stream to parse is empty")
}
docx, err := cat.FromBytes(StreamToParse)
return docx, err
}

0 comments on commit 389f5a2

Please sign in to comment.