-
Notifications
You must be signed in to change notification settings - Fork 655
Fix output for multiline column comments #779
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -251,10 +251,11 @@ def get_schema_info(klass, header, options = {}) | |
col_type = get_col_type(col) | ||
attrs = get_attributes(col, col_type, klass, options) | ||
col_name = if with_comments?(klass, options) && col.comment | ||
"#{col.name}(#{col.comment})" | ||
"#{col.name}(#{col.comment.gsub(/\n/, "\\n")})" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wanted to find something more general and elegant than There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe there's a library for sanitizing whitespace? It might be worth looking into. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I looked a bit, but didn't find anything that stuck out. I could make this more generic and escape any |
||
else | ||
col.name | ||
end | ||
|
||
if options[:format_rdoc] | ||
info << sprintf("# %-#{max_size}.#{max_size}s<tt>%s</tt>", "*#{col_name}*::", attrs.unshift(col_type).join(", ")).rstrip + "\n" | ||
elsif options[:format_yard] | ||
|
Uh oh!
There was an error while loading. Please reload this page.