How to get current line but already rendered

Hello everyone, and sorry in advance if I’ve been unable to find the response if already available.
I started working on a plugin to integrate obsidian task with Hamster time tracker and the first thing I’d like to have is to extract the “current line” to Hamster as task, but already rendered (so without any markdown formatting).
I can get the line via editor.getLine, but is there a way to have it already formatted?

thanks in advance