sirthias/pegdown

PegDownProcessor's int and long constructor overloads are confusing

Opened this issue · 0 comments

I think, it's a little bit inconvenient that PegDownProcessor(int options) and PegDownProcessor(long maxParsingTimeInMillis) constructors seem so similar, but have very different semantic.

I have tried to use pegdown from Clojure:

;; This one correctly enables fenced blocks
(let [pegdown (PegDownProcessor. Extensions/FENCED_CODE_BLOCKS)]
  ;; use pegdown here
  )

;; This one does not. Both bit-or and + return Long value.
;; Normally Long would be coerced to int, if maxParsingTimeInMillis
;; constructor did not exist
(let [pegdown (PegDownProcessor. (bit-or Extensions/FENCED_CODE_BLOCKS Extensions/TABLES))]
  ;; use pegdown here
  )