Skip to content

Commit

Permalink
add html tag link
Browse files Browse the repository at this point in the history
  • Loading branch information
Noor Wachid committed Mar 11, 2024
1 parent 1008f03 commit f09386f
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
20 changes: 20 additions & 0 deletions source/Gularen/Backend/Html/Transpiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,26 @@ class Transpiler {
return _content.append("<blockquote class=\"quote\">\n");
}

case NodeKind::accountTag: {
const AccountTag* accountTag = static_cast<const AccountTag*>(node);
_content.append("<a class=\"account-tag\" href=\"");
_escapeAttribute(accountTag->resource);
_content.append("\">@");
_escape(accountTag->resource);
_content.append("</a>");
return;
}

case NodeKind::hashTag: {
const HashTag* hashTag = static_cast<const HashTag*>(node);
_content.append("<a class=\"hash-tag\" href=\"");
_escapeAttribute(hashTag->resource);
_content.append("\">#");
_escape(hashTag->resource);
_content.append("</a>");
return;
}

default: break;
}
}
Expand Down
4 changes: 2 additions & 2 deletions source/Gularen/Frontend/Lexer.h
Original file line number Diff line number Diff line change
Expand Up @@ -526,8 +526,8 @@ class Lexer {
}

case '@': {
unsigned int oldContentIndex = _contentIndex;
_advance(1);
unsigned int oldContentIndex = _contentIndex;

while (_isBound(0) && (
(_get(0) >= 'a' && _get(0) <= 'z') ||
Expand All @@ -543,8 +543,8 @@ class Lexer {
}

case '#': {
unsigned int oldContentIndex = _contentIndex;
_advance(1);
unsigned int oldContentIndex = _contentIndex;

while (_isBound(0) && (
(_get(0) >= 'a' && _get(0) <= 'z') ||
Expand Down

0 comments on commit f09386f

Please sign in to comment.