File indexing completed on 2024-10-27 04:39:16

0001 /*
0002     SPDX-License-Identifier: GPL-2.0-or-later
0003     SPDX-FileCopyrightText: 2024 Louis Schul <schul9louis@gmail.com>
0004 */
0005 
0006 #pragma once
0007 
0008 #include <QObject>
0009 #include <QSet>
0010 
0011 class HighlightParserUtils
0012 {
0013 public:
0014     void clearInfo();
0015     void clearPreviousInfo();
0016     void preTok();
0017 
0018     void addToNoteCodeBlocks(const QString &codeBlock);
0019     void newHighlightStyle();
0020 
0021     QString renderCode(const bool highlight, const QString &_text, const QString &lang);
0022 
0023 private:
0024     bool m_newHighlightStyle = true;
0025     bool m_sameCodeBlocks = false;
0026     int m_currentBlockIndex = 0;
0027     QStringList m_noteCodeBlocks;
0028     QStringList m_previousHighlightedBlocks;
0029     QStringList m_previousNoteCodeBlocks;
0030 };