Skip to content

Commit

Permalink
style: update blockquote class
Browse files Browse the repository at this point in the history
  • Loading branch information
nparashar150 committed Oct 8, 2024
1 parent f917e80 commit d6fa420
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion generators/emitHtml.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const getTag = (type: TokenType): { openTag: string; closeTag: string } => {
case TokenType.CODE_BLOCK:
return { openTag: "<pre><code>", closeTag: "</code></pre>" };
case TokenType.BLOCKQUOTE:
return { openTag: "<blockquote>", closeTag: "</blockquote>" };
return { openTag: '<blockquote class="p-4 my-4 border-s-4 border-gray-300">', closeTag: "</blockquote>" };
case TokenType.ORDERED_LIST:
return { openTag: "<ol>", closeTag: "</ol>" };
case TokenType.UNORDERED_LIST:
Expand Down
8 changes: 5 additions & 3 deletions lexer/lineByLineLexer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { inlineStyleLexer } from "./";

const lineByLineLexer = (input: string, depth: number = 0): Token[] => {
const tokens: Token[] = [];
const lines = input.split("\n")
const lines = input.split("\n");

if (depth > MAX_NESTING_DEPTH) {
throw new Error("Maximum nesting depth exceeded");
Expand Down Expand Up @@ -344,9 +344,11 @@ const lineByLineLexer = (input: string, depth: number = 0): Token[] => {
continue;
}

// ** NORMAL TEXT CHECK
tokens.push({ type: TokenType.PARAGRAPH, value: line, children: inlineStyleLexer(line, lineIndex + 1), start: { line: lineIndex + 1, column: 0 }, end: { line: lineIndex + 1, column: line.length } });
tokens.push(...inlineStyleLexer(line, lineIndex + 1));
lineIndex++;

// // ** NORMAL TEXT CHECK
// tokens.push({ type: TokenType.PARAGRAPH, value: line, children: inlineStyleLexer(line, lineIndex + 1), start: { line: lineIndex + 1, column: 0 }, end: { line: lineIndex + 1, column: line.length } });
}

if (depth === 0) tokens.push({ type: TokenType.EOF, value: "", start: { line: lineIndex + 1, column: 0 }, end: { line: lineIndex + 1, column: 0 } });
Expand Down

0 comments on commit d6fa420

Please sign in to comment.